Determine whether an integer is a palindrome. Do this without extra space.
问题重述:Determine whether an integer is a palindrome. Do this without extra space.解答注意3个问题
1)负数是不是回文数字:不是,因为-123321中,没有和符号对称的回文。
2)如果采用倒转整数的方法,倒转后是否超出边界.
3)边界问题:输入的数字是否超出边界。class Solution {
public:
原创
2015-06-06 01:10:59 ·
579 阅读 ·
0 评论