@@ -0,0 +1,938 @@
+class Solution(object):%0A    def reverse(self, x):%0A        %22%22%22%0A        :type x: int%0A        :rtype: int%0A        %22%22%22%0A        negflag=1%0A        in_x=x%0A        if x%3C0:%0A            negflag=-1%0A            in_x=-x%0A        if in_x==0:%0A            return 0%0A            %0A        if in_x%3C10:%0A            return in_x*negflag%0A            %0A        int_res=%5B%5D%0A        while in_x:%0A            digit=in_x%2510%0A            in_x/=10%0A            int_res.append(digit)%0A        #print int_res%0A        sum_int=0%0A        start=0%0A        n=len(int_res)%0A        # get rid of the zeros%0A        for i in xrange(len(int_res)):%0A            if int_res%5Bi%5D==0:%0A                start+=1%0A            else:%0A                break%0A            %0A        res=int_res%5Bstart:n%5D%0A        for j in xrange(len(res)):%0A            sum_int+=int(res%5Bj%5D*math.pow(10,len(res)-j-1))%0A        # judge the overflow%0A        return negflag*sum_int if sum_int%3C((1%3C%3C31)-1) else 0%0A        %0A            

[7. Reverse Integer][Accepted]committed by Victor