#C9541. Mirror Number Check
Mirror Number Check
Mirror Number Check
You are given a positive integer number represented as a string. Your task is to determine whether the number is a mirror number (i.e., a palindrome). Formally, a number \( n \) is a mirror number if and only if its reverse is equal to itself. In other words, if \( n = d_1d_2\dots d_k \), then \( n \) is a mirror number if \( d_i = d_{k+1-i} \) for all \( 1 \le i \le k \).
The input starts with an integer \( T \) which indicates the number of test cases. Each test case consists of a single line containing a positive integer given as a string. For each test case, output YES
if the number is a mirror number and NO
otherwise.
inputFormat
The first line of the input contains an integer \( T \) (\( 1 \le T \le 10^5 \)) representing the number of test cases. The following \( T \) lines each contain a string, which represents a positive integer. The numbers can be very large, so they are provided as strings.
outputFormat
For each test case output a single line containing YES
if the number is a mirror number, otherwise output NO
.
3
12321
98789
12345
YES
YES
NO
</p>