Start Indices of Anagram Substrings
Asked at Oracle · Coding Questions · Difficulty: Medium · Last asked Nov 21, 2025
You are given two strings `s` and `p` made of lowercase English letters. Find every position in `s` where a substring of length `len(p)` is an anagram of `p`, that is, a rearrangement of exactly the letters of `p` (same letters, same counts). Return the start indices of these substrings.
Loading the problem…