classSolution: defisPalindrome(self, x): """ :type x: int :rtype: bool """ # 4 star, if x < 0: returnFalse div = 1 while x / div >= 10: div *= 10 while x > 0: left = x // div right = x % 10 if left != right: returnFalse x %= div x //= 10 div //= 100 returnTrue