Find All Anagrams in a String

Medium

📝 Description

Find all start indices of p's anagrams in s

Input Format

Strings s and p

Output Format

List of starting indices

Constraints

1 ≤ s.length, p.length ≤ 3 * 10^4

🔍 Sample Input

"cbaebabacd"
"abc"
            

✅ Sample Output

[0, 6]
            

Code Editor

Please login to run and submit code.

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