':type x: int
:rtype: int'

def reverse2(self, x):

    if (x < 0):
        x = int((str(x)[::(-1)][(-1)] + str(x)[::(-1)][:(-1)]))
    else:
        x = int(str(x)[::(-1)])
    x = (0 if (abs(x) > 2147483647) else x)
    return x
