Given s and p, return the start indices of every substring of s that is an anagram of p.
s
p
The result must be in ascending order.
s = "cbaebabacd", p = "abc"
[0,6]
s = "abab", p = "ab"
[0,1,2]
1 <= s.length, p.length <= 3 * 10^4 Both strings are lowercase English letters.
Topics
Implement findAnagrams in the editor and return the answer — printing it is never graded.
findAnagrams
Problem 86 of 1146 in the arena