class Solution:
# @param {integer} x
# @return {boolean}
def isPalindrome(self, x):
if x < 0:
return False
y = 0
cX = x
while x:
y = x%10 + y*10
x/=10
return cX == y
LeetCode #9 Palindrome Number
最新推荐文章于 2021-08-09 12:30:32 发布