Solution in python


  • 0
    M

    Re: Solution in Python

    class Solution:
    def reverse(self, x):
    """
    :type x: int
    :rtype: int
    """
    temp =1
    if (x < 0):
    x = x*-1
    temp = temp * -1
    y = str(x)[::-1]
    y = int(y)
    y = y * temp
    return y


Log in to reply
 

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