9. Palindrome Number Leetcode Python 2016 new Season
来源:互联网 发布:手机炒股软件ene 编辑:程序博客网 时间:2024/06/08 19:59
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Show Similar Problems
The problem requirement doesn't make sense, we still need constant space to do this problem. the time complexity is O(log(n)).
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ tmp_x = x residual = 0 while x >= 1: rest = x % 10 residual = residual * 10 + rest x /= 10 if tmp_x == residual: return True return False
0 0
- 9. Palindrome Number Leetcode Python 2016 new Season
- 1. Two Sum Leetcode Python New season for 2016
- 2.Add Two Numbers Leetcode Python New season for 2016
- 5. Longest Palindromic Substring Leetcode Python 2016 new Season
- 6. ZigZag Conversion Leetcode Python 2016 new Season
- 10. Regular Expression Matching leetcode Python 2016 new Season
- 11. Container With Most Water leetcode Python 2016 new Season
- 12. Integer to Roman python leetcode 2016 new Season
- 13. Roman to Integer leetcode Python 2016 new Season
- 14. Longest Common Prefix leetcode Python 2016 new Season
- 15. 3Sum leetcode python 2016 new Season
- 16. 3Sum Closest leetcode Python 2016 new Season
- 18. 4Sum leetcode Python 2016 new Season
- 20. Valid Parentheses leetcode Python 2016 new Season
- 21. Merge Two Sorted Lists leetcode Python 2016 new Season
- 22. Generate Parentheses leetcode Python 2016 new Season
- 23. Merge k Sorted Lists python leetcode 2016 new Season
- 24. Swap Nodes in Pairs leetcode Python 2016 new Season
- hadoop 平衡空间设置方法
- hive 客户端查询报堆内存溢出解决方法
- presentViewController弹出有几种可以选择的类型
- linux tune2fs命令详解
- 大数据学习之Scala中main函数的分析以及基本规则(2)
- 9. Palindrome Number Leetcode Python 2016 new Season
- 软件开发中的一些概念?
- 影响网站排名的身分有哪些
- 互联网大公司与创业公司
- java面试题
- openfire 使用hazelcast插件实现集群配置
- C语言中fstat、stat和lstat 区别
- ajax为什么会返回一段html代码
- 判断字符串中是否仅包含字母数字和汉字