#K4376. Check Palindromic Strings
Check Palindromic Strings
Check Palindromic Strings
You are given a series of numeric strings. For each string, determine whether it is a palindrome. A string is considered a palindrome if it reads the same forwards and backwards. For example, the string \( s \) is a palindrome if \( s = reverse(s) \).
For each test case, print YES
if the string is a palindrome or NO
otherwise.
Example:
Input: 3 12321 404 123456</p>Output: YES YES NO
inputFormat
The input begins with an integer ( T ) (1 ≤ T ≤ 1000) representing the number of test cases. Each of the following ( T ) lines contains a single numeric string.
outputFormat
For each test case, output on a new line YES
if the given string is a palindrome, or NO
otherwise.## sample
3
12321
404
123456
YES
YES
NO
</p>