9.回文数--python

题目:判断一个整数是否为回文数

法:将整数转换为字符串,用左右指针即可

def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
        s=str(x)
        left,right=0,len(s)-1
        while left

 

你可能感兴趣的:(leetcode,python)