leetcode Palindrome Number python
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return False x=str(x) i=0 j=len(x)-1 while i < j: if x[i] != x[j]: return False i+=1 j-=1 return True
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return False x=str(x) i=0 j=len(x)-1 while i < j: if x[i] != x[j]: return False i+=1 j-=1 return True