CodeMentor.
Ask AIProblemsLearnC++TCSCore CSHRProgress
0Lv 1
ProblemsSliding Window

Find All Anagrams in a String

Medium
LeetCode
6/6
MediumSliding WindowLeetCode #438

Find All Anagrams

Fixed window = p.length(). Compare freq maps (or match counter).

Examples

Example 1

Input

cbaebabacd abc

Output

0 6
Example 2

Input

abab ab

Output

0 1 2

Stuck? Take a nudge

C++17Autosaves