Save Ironman
Submissions: 28153   Accuracy:

23.71%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Interview Preparation
       

Jarvis is weak in computing palindromes for Alphanumeric characters.
While Ironman is busy fighting Thanos, he needs to activate sonic punch but Jarvis is stuck in computing palindromes.
You are given a string S containing alphanumeric characters. Find out whether the string is a palindrome or not.
If you are unable to solve it then it may result in the death of Iron Man.

Input:
The first line of the input contains T, the number of test cases. T testcases follow.  Each line of the test case contains string 'S'.

Output:
Each new line of the output contains "YES" if the string is palindrome and "NO" if the string is not a palindrome.

Constraints:
1<=T<=100
1<=|S|<=100000
Note: Consider alphabets and numbers only for palindrome check. Ignore symbols and whitespaces.

Example:
Input:

2
I
am :IronnorI Ma, i
Ab?/Ba

Output:
YES
YES

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

Contributor: chunky_2808
Author: Chunky_2808


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

to report an issue on this page.