LeetCodePalindrome Number

Posted 你瞅啥

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCodePalindrome Number相关的知识,希望对你有一定的参考价值。

题目如下:

Python代码:

    def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
        if(x>=0):
            s = int(str(x)[::-1])
            if(x==s):
                return True
            else:
                return False
        else:
            return False

 

以上是关于LeetCodePalindrome Number的主要内容,如果未能解决你的问题,请参考以下文章

LeetcodePalindrome Partitioning

LeetcodePalindrome Partitioning II

LeetCodePalindrome Partitioning 解题报告

类型 '() => number' 不可分配给类型 'number'

number - Number.isInteger()

js中为啥NaN的返回类型为number