Skip to main content
Find All Anagrams in a String | AlgoCracked
AlgoCracked
ProblemsFind All Anagrams in a String
Medium49.0% acceptance
Hash TableStringSliding Window

Find All Anagrams in a String

Given two strings s and p , return the start indices of every substring of s that is an anagram of p . An anagram is a rearrangement of the same multiset of letters. Return the indices in ascending order. Input format Input is [s, p] , e.g. [ cbaebabacd , abc ] .

Loading workspace…