class Solution(object):
    def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
        if x < 0:
            return False
        x=str(x)
        i=0
        j=len(x)-1
        while i < j:
            if x[i] != x[j]:
                return False
            i+=1
            j-=1
        return True

 

相关文章:

  • 2022-01-08
  • 2021-08-26
  • 2022-01-20
  • 2022-12-23
猜你喜欢
  • 2022-01-13
  • 2022-02-20
  • 2021-08-14
  • 2022-02-08
  • 2021-12-21
  • 2022-03-08
相关资源
相似解决方案