1-line beat 82.65% python code


  • 0

    class Solution(object):
    def isPalindrome(self, x):
    """
    :type x: int
    :rtype: bool
    """
    return int(str(abs(x))[::-1]) == x


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.