Count Occurrences of Anagrams
Medium

Problem Statement

Given a word and a text, return the count of occurrences of anagrams of the word within the text.

Examples

1Example 1
Input:
{ "txt": "forxxorfxdofr", "pat": "for" }
Output:
3
2Example 2
Input:
{ "txt": "aabaabaa", "pat": "aaba" }
Output:
4
3Example 3
Input:
{ "txt": "cbaebabacd", "pat": "abc" }
Output:
2
Loading...

Sign in to Run Code and Submit