Determine whether an integer is a palindrome. Do this without extra space.
Solution
class Solution(object):
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
return str(x) == str(x)[::-1]
思考
- 有没有办法通过除数/余数就能够完成比较?