#7
def reverse(x):
x = int(str(x)[::-1]) if x >= 0 else - int(str(-x)[::-1])
return x if x < 2147483648 and x >= -2147483648 else 0
#258
def addDigits(num):
return 1 + (num - 1) % 9
#7
def reverse(x):
x = int(str(x)[::-1]) if x >= 0 else - int(str(-x)[::-1])
return x if x < 2147483648 and x >= -2147483648 else 0
#258
def addDigits(num):
return 1 + (num - 1) % 9