Python 2 line Solution (45ms)


  • 0
    S
    def reverse(self, x):
            if x >= 0: k = int(''.join(reversed(str(x))));return k*(k < 2 **31)
            else:  k = -1*int(''.join(reversed(str(-1*x))));return k*(k > -2**31)
    '''

Log in to reply
 

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