Problem
Given strings s and p, return the start index of every substring of `s` that is an anagram of `p` (the same letters with the same counts, in any order). Return the indices in increasing order.
Example 1
- Input
- s = "cbaebabacd", p = "abc"
- Output
- [0, 6]
- Why
- "cba", "bac"
Example 2
- Input
- s = "abab", p = "ab"
- Output
- [0, 1, 2]
Example 3
- Input
- s = "a", p = "ab"
- Output
- []
Constraints
1 <= s.length, p.length <= 3 * 10^4s and p consist of lowercase English letters.