#K86567. Palindromic String Checker
Palindromic String Checker
Palindromic String Checker
Given a string, determine whether it is a palindrome when considering only its alphanumeric characters and ignoring cases. A string is a palindrome if it reads the same forward and backward after removing all non-alphanumeric characters. Formally, for a string \( s \), let \( s' \) be the string after removing non-alphanumeric characters and converting to lower-case. The string is a palindrome if \( s' = \left(s'\right)^R \), where \( \left(s'\right)^R \) denotes the reverse of \( s' \).
You will be given several test cases. For each test case, output Yes
if the string is a palindrome, and No
otherwise.
inputFormat
The first line of input contains a single integer \( T \) (\(1 \leq T \leq 100\)) representing the number of test cases.
Then, \( T \) lines follow. Each line contains a string. The string may contain spaces, punctuation, and mixed case letters.
Input is provided via stdin.
outputFormat
For each test case, output a single line containing Yes
if the string is a palindrome (after processing), or No
otherwise.
Output is printed to stdout.
## sample2
A man, a plan, a canal: Panama
race a car
Yes
No
</p>