Palindrome Checking

3.7

3 votes
Problem

A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Allowances may be made for adjustments to capital letters, punctuation, and word dividers. An example of a palindrome is “Able was I, ere, I saw Elba.” In this problem, you will be checking whether a string of characters forms a palindrome.


INPUT:
The first line of input contains a single number N, the number of strings in the test case. N lines follows. Each string consists only of numbers, and has a maximum length of 200. There are no empty strings in the input.


OUTPUT:
Simply output “PALINDROME” or “NOT PALINDROME” on a line by itself, as the case may be.

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?