Extra rep
Rep 3of 4 in this section
Combination Rep~11 min
Hidden anagram
pattern and s are strings of lowercase letters. Write has_anagram(pattern, s): return True if some substring of s with length len(pattern) uses exactly the same letters as pattern (same counts, any order). If pattern is longer than s, return False.
has_anagram("ab", "eidbaooo") → True ("ba")
Slide a fixed window with a count dict; compare dicts with ==.
main.pypracticePython