Approach Summary
Slide a window of length p.length across s. At each step compare frequency maps; collect starting indices where they match.
How to Recognize This Pattern
- Find all anagram positions
Complexity Analysis
Time Complexity
O(n)
Space Complexity
O(1)
Tags
String Hash Map Sliding Window