dsa · medium

Anagram Substring Count

Count how many substrings of txt are anagrams of pat.

Arguments

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

Example

`` Input: forxxorfxdofr for Output: 3 ``

Constraints

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

Examples

Example 1

Input:
forxxorfxdofr
for

Expected:
3

Open in the Dojo editor