2 lines python solution


  • 0
    F
        def reverse(self, x):
            result = cmp(x, 0) * int(str(abs(x))[::-1])
            return 0 if result < -2 ** 31 or result >= 2 ** 31 else result

Log in to reply
 

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