Server Time: Mon Oct 26, 2020 6:57 am
Welcome ( logout
A - Phrase-Palindrome
PDF (English) Ranklist
Time Limit: 2 second(s) Memory Limit: 32 MB

Problem Description:

Write a function that takes a string as a parameter and returns True if the string is a palindrome, False otherwise. Remember that a string is a palindrome if it is spelled the same both forward and backward. for example: ‘radar’ is a palindrome.

To make it more interesting, you will also consider that palindromes can also be phrases, but you need to remove the spaces and punctuation before checking. for example: “madam i’m adam” is a palindrome.

Other fun palindromes include:

  kayak

  aibohphobia

  Live not on evil

  Reviled did I live, said I, as evil I did deliver • Go hang a salami; I’m a lasagna hog.

  Able was I ere I saw Elba

  Kanakanak – a town in Alaska

  Wassamassaw – a town in South Dakota

Input

First line of input contains a positive integer T (T ≤ 100), where T denotes the number of test cases. This line is followed by T more lines, where each line contains a string S.

Output

For each line of input, there will be one line of output – “yes” if the input is a palindrome; “no” otherwise.

Sample Input

8 aibohphobia Live not on evil

Root the toor

Reviled did I live, said I, as evil I did deliver Go hang a salami; I’m a lasagna hog

mobobmo

Able was I ere I saw Elba

Kanakanak

Sample Output

yes

yes

no

yes

yes

no

yes

yes


Problem Setter: Siddiqui
Problem Source: Book
Developed and Maintained by
JANE ALAM JAN
Copyright © 2012
LightOJ, Jane Alam Jan