Substring with Concatenation of All Words

Hard

📝 Description

Find all starting indices of substrings that are concatenation of each word

Input Format

String s and list of words

Output Format

List of starting indices

Constraints

1 ≤ s.length ≤ 10^4

🔍 Sample Input

"barfoothefoobarman"
["foo","bar"]
            

✅ Sample Output

[0,9]
            

Code Editor

Please login to run and submit code.

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