摘要:
题目链接:https://leetcode-cn.com/problems/palindrome-number/description/ class Solution: def reverse(self, x): if (x < 0): return False temp = str(x)[::-1 阅读全文
摘要:
题目链接:https://leetcode-cn.com/problems/reverse-integer/description/ 思路:先判断正负,负数转换为正数,然后将其变换为字符串,然后[::-1]进行反转就可以了 class Solution: def reverse(self, x): 阅读全文