Find All Anagrams in a String
Examples
Example 1:
Input: s = "cbaebabacd", p = "abc"
Output: [0,6]
Example 2:
Input: s = "abab", p = "ab"
Output: [0,1,2]
Example 1:
Input: s = "cbaebabacd", p = "abc"
Output: [0,6]
Example 2:
Input: s = "abab", p = "ab"
Output: [0,1,2]
Given two strings s and p, return an array of all the start indices of p's anagrams in s.
You may return the answer in any order.
1 <= s.length, p.length <= 3 * 10^4s and p consist of lowercase English letters.