dsa · medium

Anagram Substring Count

GreyOrangeStringSliding WindowHash Map

Count how many substrings of txt are anagrams of pat.

Arguments

**Example:** txt="forxxorfxdofr", pat="for"3.

Constraints

1 <= len(txt) <= 10^4

Examples

Example 1

Input:
forxxorfxdofr
for

Expected:
3

Open in the Dojo editor