Coding

Count Anagrammatic Substrings

Count the number of anagrammatic substrings from one string present in another.

Input: s = "abab", p = "ab"

Output: [0, 1, 2]

Explanation: The substrings "ab", "ba", and "ab" starting at indices 0, 1, and 2 respectively are all anagrams of the string "ab".

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

Community Answers

1 answer from the community

Unlock Full Access

Answer any un-answered question from our database to unlock all community answers for 30 days.

Give & Take

Practice More Questions