#9 Palindrome Number
2015-06-21 13:48
288 查看
题目链接:https://leetcode.com/problems/palindrome-number/
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to string, note the restriction of using extra space.
You could also try reversing an integer. However, if you have solved the problem "Reverse Integer", you know that the reversed integer might overflow. How would you handle such case?
There is a more generic way of solving this problem.
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to string, note the restriction of using extra space.
You could also try reversing an integer. However, if you have solved the problem "Reverse Integer", you know that the reversed integer might overflow. How would you handle such case?
There is a more generic way of solving this problem.
相关文章推荐
- Java中如何处理空指针异常
- codeforces #307 D. GukiZ and Binary Operations(各种快速幂+斐波那契)
- 调用ShellExecute需要头文件
- 深入浅出 nginx lua 为什么高性能
- ava集合类详解
- 第14周项目2-用文件保存的学生名单
- iOS-Reachability的使用
- 第14周项目1-小玩文件(4)键盘输入文件名统计数据
- 第十四周 【项目2-用文件保存的学生名单】若干名学生的学号 姓名和C++课、高数和英语成绩
- setTimeout和setInterval区别
- 决策树[Decision Tree]
- 素数
- android layout物业介绍
- 互斥锁机制
- 在xbox配置hadoop伪分布中主要遇到的问题以及解决的办法
- 第14周项目1-小玩文件(3)键盘输入文件名统计字母、数字
- 【转】【SSE】基于SSE指令集的程序设计简介
- C++的4种类型转换关键字及其特点
- 水仙花数
- 64位win7启动VirtualBox出错Error e_fail 0x80004005