#C4397. Palindrome Checker
Palindrome Checker
Palindrome Checker
Given a string s, determine whether it is a palindrome. A string is a palindrome if it reads the same forwards and backwards. In mathematical terms, a string s is a palindrome if \( s = s^{\text{rev}} \), where \( s^{\text{rev}} \) denotes the reverse of \( s \).
You are required to process multiple test cases from the standard input and for each test case, output YES
if the string is a palindrome, otherwise output NO
.
inputFormat
The first line of the input contains an integer \(T\) (\(1 \leq T \leq 100\)), which denotes the number of test cases. Each of the following \(T\) lines contains a non-empty string s consisting of lowercase English letters.
outputFormat
For each test case, print a single line containing YES
if the string is a palindrome, or NO
otherwise.
3
radar
hello
level
YES
NO
YES
</p>