First Anagram Occurrence

Given strings s and p, return the starting index of the first contiguous substring of s that is an anagram of p. Return -1 if no such substring exists.

Both strings contain only lowercase E...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: