PALIN  The Next Palindrome
A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers are always displayed without leading zeros.
Input
The first line contains integer t, the number of test cases. Integers K are given in the next t lines.
Output
For each K, output the smallest palindrome larger than K.
Example
Input: 2 808 2133 Output: 818 2222
Warning: large Input/Output data, be careful with certain languages
hide comments
ankkt16:
20190313 15:56:34
just form the string dealing with all the cases:) 

raycu:
20190313 04:01:00
Lol, I didn't read the prompt and now my code isn't suitable for this. It does accurately determine palindromes, but only if they're smaller than the specified size (I used integer inputs instead of string inputs like a dumbass). 

wrong_amoeba:
20190307 19:41:56
I have tested many testcases but still answer is wrong .Can anyone help me?


ayder:
20190227 00:18:35
don't forget cases:


sibindon:
20190216 19:28:03
I gave up after 2 days....


lunaticgaming:
20190215 04:44:10
Execution Time: .04


deep123r:
20190214 17:14:15
Check for these things


mighty_joe781:
20190212 07:42:13
I am also getting TLE any ideas. 

randm_codr_rs:
20190205 14:15:20
I'm getting runtime error NZEC in this problem while submitting


venom_black:
20190118 14:37:29
too hard 
Added by:  adrian 
Date:  20040501 
Time limit:  2s9s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL6 