Palindromic Series
Submissions: 1499   Accuracy:

36.42%

  Difficulty: Easy   Marks: 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

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Siddhant Manglik
Author: adobe_3128


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.