Given two strings a and b. The task is to find if a string 'a' can be obtained by rotating another string 'b' by 2 places.
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. In the next two line are two string a and b.
For each test case in a new line print 1 if the string 'a' can be obtained by rotating string 'b' by two places else print 0.
1 <= T <= 50
1 <= length of a, b < 100
Testcase 1: amazon can be rotated anti-clockwise by two places, which will make it as azonam.
Testcase 2: geeksgeeksfor can't be formed by any rotation from the given word geeksforgeeks.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.