leetcode

438. Find All Anagrams in a String

Solution

n = s and m = p

Time complexity: O(n+m)

k = alphabet = 26

Space complexity: O(k)