Anagram substring indices
Your task
Given a lowercase text string s and a lowercase pattern p, return the start indices of all substrings of s that are anagrams of p (same multiset of characters), in increasing order. For s='cbaebabacd', p='abc' return [0,6]. Lengths up to a few thousand.
Examples
find_anagram_indices(s: str, p: str) -> list[int]Example 1
Input
find_anagram_indices("cbaebabacd", "abc")Output
[0, 6]