Problems > Anagram Windows > Editorial

Anagram Windows — Solution & Editorial

Back to the Problem

Slide a |P|-sized window over T maintaining a letter-count map; compare against P's counts (track a matched-letters counter for O(1) updates).

Complexity: O(|T|)