Created
January 19, 2015 22:03
-
-
Save g-p-g/8be54b08db4284bf5461 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from string import maketrans | |
trans = maketrans( | |
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', | |
'22233344455566677778889999' | |
) | |
num = int(sys.stdin.next()) | |
for line in sys.stdin: | |
res = line.strip().upper().translate(trans) | |
print 'YES' if res == res[::-1] else 'NO' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment