Hi Guys, I have been having problems with this one and its bothering me coz its so easy.
I've implemented on python take a look please, I am getting TLE.
Any hints and suggestions would count.
import math
def NextPalindrome():
Input = str(input())
Len = float(len(Input))
SubLen = int(Len/2)
EOCare = int(math.ceil(Len/2))
if Input[:SubLen][::-1]>Input[-SubLen:]:
print(Input[:EOCare]+Input[:SubLen][::-1])
else:
TempVar = str(int(Input[:EOCare]) + 1)
print(TempVar+TempVar[:SubLen][::-1])
CaseCount = int(input())
while CaseCount!=0:
NextPalindrome()
CaseCount-=1