题目
Given a string s and a non-empty string p, find all the start indices of p‘s anagrams in s.
Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100.
The order of output does not matter.
Example 1:
1 | Input: |
Example 2:
1 | Input: |
思路
滑动窗口+双指针。
代码
1 | class Solution(object): |