Medium
,String
,Hash Table
,Sliding Window
438. Find All Anagrams in a String
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.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Example 1:
Example 2:
Constraints:
s.length
, p.length
<= 3 * 104s
and p
consist of lowercase English letters.Yen-Chi ChenSun, Feb 5, 2023
Yen-Chi ChenSun, Feb 5, 2023
MarsgoatSun, Feb 5, 2023