Check if a given string is a rotation of a palindrome
Submissions: 3108   Accuracy:

25.55%

  Difficulty: Easy   Marks: 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

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

Author: Jaspreet Singh


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.



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


to report an issue on this page.