'''
Given an integer x, return true if x is palindrome integer.

An integer is a palindrome when it reads the same backward as forward.

For example, 121 is a palindrome while 123 is not.
'''

class Solution:
    def isPalindrome(self, x: int) -> bool:
        if(x<0 or (x%10 == 0 and x != 0)):
            return False
        revertedNumber = int(0)
        while(x>revertedNumber):
            revertedNumber = revertedNumber*10+x%10
            x//=10
        return x==revertedNumber or x==revertedNumber//10

if __name__ == "__main__":
    Answer=Solution()
    print("12321 is %r" %(Answer.isPalindrome(12321)))
    print("11 is %r" % (Answer.isPalindrome(11)))
    print("1221 is %r" % (Answer.isPalindrome(12321)))
    print("12345 is %r" % (Answer.isPalindrome(12345)))
'''
Given an integer x, return true if x is palindrome integer.

An integer is a palindrome when it reads the same backward as forward.

For example, 121 is a palindrome while 123 is not.
'''

class Solution:
    def isPalindrome(self, x: int) -> bool:
        if(x<0 or (x%10 == 0 and x != 0)):
            return False
        revertedNumber = int(0)
        while(x>revertedNumber):
            revertedNumber = revertedNumber*10+x%10
            x//=10
        return x==revertedNumber or x==revertedNumber//10

if __name__ == "__main__":
    Answer=Solution()
    print("12321 is %r" %(Answer.isPalindrome(12321)))
    print("11 is %r" % (Answer.isPalindrome(11)))
    print("1221 is %r" % (Answer.isPalindrome(12321)))
    print("12345 is %r" % (Answer.isPalindrome(12345)))
Given an integer x, return true if x is palindrome integer.  An integer is a palindrome when it reads the same backward as forward.  For example, 121 is a palindrome while 123 is not.