Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Find All Anagrams in a String
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given a string s and a pattern p, find all start indices of p's anagrams in s.
Sample Input:
"cbaebabacd", "abc"
Sample Output:
[0,6]
Hints
Hint 1
Use sliding window of size pattern length
Hint 2
Compare character counts in window with pattern
Hint 3
Use array of size 26 for character counts
Code Editor
Reset
Run
Save
Loading...