#K51657. Palindrome Checker
Palindrome Checker
Palindrome Checker
Given a string s, determine whether it is a palindrome. In this problem, only alphanumeric characters are considered and case is ignored. Formally, let \(s'\) be the string obtained by removing all non-alphanumeric characters from \(s\) and converting it to lowercase, then the string is a palindrome if and only if
\[
s' = \text{reverse}(s')
\]
You are given multiple test cases. For each test case, output "YES" if the corresponding string is a palindrome, and "NO" otherwise.
inputFormat
The first line contains an integer T denoting the number of test cases. Following this, there are T lines, each containing a string. The string may contain spaces, punctuation and mixed case letters.
outputFormat
For each test case, output a single line containing either "YES" if the string is a palindrome or "NO" if it is not.
## sample4
A man, a plan, a canal: Panama
race a car
No lemon, no melon
12321
YES
NO
YES
YES
</p>