Check if palindromic ignoring spaces
Submissions: 1966   Accuracy:

40.66%

  Difficulty: Easy   Marks: 2

Given a string, check if it is a palindrome by ignoring spaces. E.g. race car would be a palindrome.

Input:
The first line of input contains an integer T denoting the no of T test cases. The only line in each test case consists of String S.


Output:
For each test case in a new line print YES if String is palindromic else print NO.


Constraints:
1<=T<=100
1<=|Length of String|<=1000

Example:
Input:
2
race car
abcaa

Output:
YES
NO

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

Contributor: Saksham Raj Seth
Author: saksham seth


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.