'''

class Solution:

def reverse(self, x):

s = (x > 0) - (x < 0) #check if the number is positive or negative

r = int(str(s*x)[::-1]) #slicing the number, making it absolute and reversing it
return r*s*(r < 2**31 - 1) #checking for overflow

'''