This solution is actually just for fun!

```
from collections import Counter
class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
def hash(key):
count = Counter(key)
p1 = 2903
p2 = 29947
sHash = 0
for c in string.ascii_lowercase:
sHash = sHash * p1 + count.get(c, 0)
p1 *= p2
return sHash
lenS = len(s)
lenP = len(p)
pKey = hash(p)
ans = []
countCache = Counter(p)
i = 0
while i < lenS - lenP + 1:
j = i
for j in range(i, i + lenP):
if s[j] not in countCache:
i = j
break
if hash(s[i:i + lenP]) == pKey:
ans.append(i)
i += 1
return ans
```