BETA

Difficulty Level: Easy

Submissions: 2211 Accuracy:

43.87%

Count Occurences of Anagrams
     

Given a word and a text, return the count of the occurences of anagrams of the word in the text(For eg: anagrams of word for are for, ofr, rof etc.))

Input:
The first line of input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a text  consisting of only lowercase Latin Letters.
The second line contains a word consisting of only lowercase Latin Letters.

Output:
Print the count of the occurences of anagrams of the word in the text.

Constraints:
1 <= T <= 50
1 <= |word|<= |text| <= 50
here |word| denotes the size of word and |text| denotes the size of text 

Example:
Input:
2
forxxorfxdofr
for
aabaabaa
aaba

Output:
3
4

Explaination:
for, orf and ofr
appears in the first test case and hence answer is 3.

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.