class Solution(object): def reverse(self, x): \"\"\" :type x: int :rtype: int \"\"\" negative = False if(x < 0):
if sum > ((1 << 31) - 1): return 0 else: if negative == True: sum = -sum return sum