MAGICNAM - Magical Names
In Ancient Greek villages, people liked to name their kids such that the name remains the same when read forward or backward. They called these names magical. Given a string S, determine if it is a magical name or not.
Input
The first line contains T, the number of test cases. The next T lines contain a string each.
Output
For each test case, output "YES" if the string is magical, and "NO" otherwise.
Constraints
1 <= T <= 100
1 <= |S| <= 10
Example
Input:> 2 aba ab Output:> YES NO
Added by: | kousik |
Date: | 2013-09-12 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |