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]
思考
- 有沒有辦法通過除數/余數就能夠完成比較?