Exercises/#124 Find All Anagrams in a String
#124

Find All Anagrams in a String

MediumπŸ”€ Strings
85 XP

Problem

Given strings s and p, find all start indices of p's anagrams in s.

Examples

Input: s = 'cbaebabacd', p = 'abc'
Output: [0, 6]

Input: s = 'abab', p = 'ab'
Output: [0, 1, 2]
stringsliding-windowhash-map
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

124 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features