Palindromic Series
Easy Accuracy: 38.05% Submissions: 1831 Points: 2

Adobe wants to play a game. He is given a number N. He has to create a alphabetical string in lower case from that number and tell whether the string is palindrome or not. a = 0 , b = 1….. and so on.  For eg : If the number is 61 the substring “gb” will be printed till 7 (6+1) characters i.e. “gbgbgbg” and check if palindrome or not. Adobe is weak in concepts of palindrome and strings, help him in winning the game.
Note: No number will start with zero. Consider alphabets ' a to j ' only i.e. single digit numbers from 0 to 9.

Input: 

The first line of input contains integer T denoting the number of test cases. For each test case , there is a line containing a number N. None of the number start with a zero.
Output:

 For each test case, print “YES” if the string is palindrome and “NO” if not.
Constraints:

1<=T<=10000

1<=N<=10^7
Example:

Input:

4

61

10101

1998

1234567

Output:

YES

YES

NO

NO

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.