Useless Solution


  • 0
    W
    class Solution(object):
        def reverse(self, x):
            """
            :type x: int
            :rtype: int
            """
            return int(str(x)[::-1]) if 2**31-1>=x>=0 and 2**31-1>=int(str(x)[::-1]) else (int("-"+str(x)[-1:0:-1]) if -(2**31)<=x<0 and int("-"+str(x)[-1:0:-1])>=-(2**31) else 0)
    

Log in to reply
 

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