Two words are anagrams if they use the same letters the same number of times, in any arrangement. For example, "tea" and "eat" are anagrams.
Given two strings s and p, find every place in s where an anagram of p starts. Return the start positions. You can return the positions in any order.
Examples
Example 1:
Input: s = "abcbacab", p = "abc"
Output: [0,2,3,5]
Explanation: The parts starting at 0, 2, 3 and 5 are "abc", "cba", "bac" and "cab". All are anagrams of "abc".
Example 2:
Input: s = "aaaa", p = "aa"
Output: [0,1,2]
Explanation: The parts starting at 0, 1 and 2 are all "aa".
Example 3:
Input: s = "hello", p = "xyz"
Output: []
Explanation: No part of "hello" is an anagram of "xyz", so the answer is an empty list.