Shortest Way to Form String

Medium

📝 Description

Find minimum subsequences of source needed to form target

Input Format

Strings source and target

Output Format

Minimum number of subsequences

Constraints

1 ≤ source.length, target.length ≤ 1000

🔍 Sample Input

"abc"
"abcbc"
            

✅ Sample Output

2
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run