题目
代码
class Solution:
def isPalindrome(self, x: int) -> bool:
x = str(x)
def help(i,j):
while i >= 0 and j < len(x):
if x[i] == x[j]:
i -= 1
j += 1
else:
return False
if i == -1 and j == len(x):
return True
else:
return False
if len(x)%2 == 1:
return help(len(x)//2, len(x)//2)
else:
return help(len(x)//2-1, len(x)//2)