N Boy and Palingrams
All submissions for this problem are available.
For Turbo C++ Users : Read the following document before attempting the question :
Switching from Turbo to GNU
N-Boy is very eccentric when it comes to strings. These days, he spends most of his time studying palindromes and pangrams (for his IP assignment at IIITD). For those of you who don’t know, a palindrome is a word or a statement which can be read the same way, forward or backward, and a pangram is a word or a statement containing all letters of the English alphabet.
Now, he is given a set of strings, and he wants to segregate them into palindromes, pangrams and palingrams, which are palindromic pangrams. Unfortunately, he is unable to do so, and has asked you for help.
The first line consists of a single integer T, denoting the number of test cases.
Each test case consists of a string S of lowercase English characters.
For each test case, output a single line containing a string(without quotes) as follows:
- If the string is only a palindrome, print ‘palindrome’.
- If the string is only a pangram, print ‘pangram’.
- If it is a palingram, print ‘palingram’.
- Else, print ‘none’.
- 1 ≤ T ≤ 1000
- 1 ≤ |S| ≤ 1000
Input: 3 abba abcdefghijklmnopqrstuvwxyz qwerty Output: palindrome pangram none
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6|
Fetching successful submissions