This commit is contained in:
sangge-rockpi 2024-01-19 22:18:07 +08:00
parent 4985021976
commit 27af23f4d6

View File

@ -3,6 +3,8 @@
class Solution: class Solution:
def isPalindrome(self, x: int) -> bool: def isPalindrome(self, x: int) -> bool:
if x < 0:
return False
str_x = str(x) str_x = str(x)
inv_str_x = str_x[::-1] inv_str_x = str_x[::-1]
int_inv_str_x = int(inv_str_x) int_inv_str_x = int(inv_str_x)