arrow_back Back to Challenges

#438 Find All Anagrams in a String

Medium Acceptance 0%
description

Problem Description

Given two strings `s` and `p`, return an array of all the start indices of `p`'s anagrams in `s`. You may return the answer in any order.

checklist Constraints

1 <= s.length, p.length <= 3 * 10^4
s and p consist of lowercase English letters.

science Examples

Case #1

In: s = "cbaebabacd" p = "abc"
Out: [0,6]

Case #2

In: s = "abab" p = "ab"
Out: [0,1,2]

Mastery Tags

Hash Table Sliding Window Strings

Hiring Companies

Amazon Google Meta
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude