Dsa
Sliding Window
Medium
Number of Anagrams
Given a string s and a string p, return the number of start indices of p's anagrams in s.
Example:
Input: s = 'cbaebabacd', p = 'abc'
Output: 2 (Found anagrams of 'abc' at indices 0 and 6.)
Key concepts
sliding_windowstringpermutation
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now