#K421. Palindromic String Checker
Palindromic String Checker
Palindromic String Checker
Given a string s, determine whether it is a palindrome. A palindrome is a string that reads exactly the same forwards and backwards. The problem is case-sensitive; for example, "Madam" is considered non-palindromic if considered with its uppercase letter.
You are given an integer T that denotes the number of test cases. Each test case consists of a single string. For each string, determine if it is a palindrome and output "YES" if it is a palindrome, and "NO" otherwise.
Note: The solution should read input from standard input (stdin) and print the result to standard output (stdout), with each result printed on a new line.
Examples:
- Input:
3\nmadam\nhello\ndeed
Output:YES\nNO\nYES
- Input:
2\nabba\nabca
Output:YES\nNO
- Input:
1\na
Output:YES
inputFormat
The first line of input contains an integer T representing the number of test cases.
Each of the next T lines contains a single string to be checked.
outputFormat
For each test case, output a single line containing "YES" if the given string is a palindrome, or "NO" otherwise.
## sample3
madam
hello
deed
YES
NO
YES
</p>