#K44267. Palindrome Checker
Palindrome Checker
Palindrome Checker
You are given a list of strings. For each string, determine whether it is a palindrome. A string is considered a palindrome if it reads the same backward as forward.
For each string in the input, output YES
if it is a palindrome, otherwise output NO
.
Note: The comparison is case-sensitive and an empty string is considered a palindrome.
inputFormat
The first line of input contains an integer T (1 ≤ T ≤ 100) which is the number of test cases. Each of the following T lines contains a non-empty string s (or possibly an empty string) which you need to check for being a palindrome.
outputFormat
For each test case, output a single line containing YES
if the string is a palindrome, and NO
otherwise.
4
radar
hello
level
world
YES
NO
YES
NO
</p>