Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 500 Bytes

File metadata and controls

12 lines (9 loc) · 500 Bytes

Problem 15: Sliding Permutation Window (Find All Anagrams in a String)

Problem Statement

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.

Input Format

  • Two strings s and p.

Example

Input: s = "cbaebabacd", p = "abc"
Output: [0, 6] Explanation: The substring with index 0 is "cba", which is an anagram of "abc". The substring with index 6 is "bac", which is an anagram of "abc".