Check if a given string is a rotation of a palindrome
Easy Accuracy: 24.05% Submissions: 3642 Points: 2

Given a string, check if it is a rotation of a palindrome. For example “aab” is a rotation of “aba”.

Input:
The first line contains T denoting the number of testcases. Then follows description of testcases. 
Each case contains a string.


Output:
For each test case, output "1" if string is rotation of a palindrome otherwise "0" in a new line.

 

Constraints:
1<=T<=100
1<=Length of the string<=100


Example:
Input:
1
aab

Output:
1

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.