标签:obj ret int integer class str type code turn
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ p=abs(x) rev=int(str(p)[::-1]) if(x<0): if((-rev)<pow(-2,31)): return 0 else: return -(rev) else: if(rev>(pow(2,31)-1)): return 0 else: return rev
leetcode 7-> Reverse Integer(32-bit signed integer)
标签:obj ret int integer class str type code turn
原文地址:https://www.cnblogs.com/sea-stream/p/10489071.html