Question:
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:
Example 2:
Explanation
暴力解会超时。需要采用sliding window的方法。 参照 https://discuss.leetcode.com/topic/64434/shortest-concise-java-o-n-sliding-window-solution 另外还有一些总结的模板: https://discuss.leetcode.com/topic/30941/here-is-a-10-line-template-that-can-solve-most-substring-problems