
leetcode 其他
a7895906
这个作者很懒,什么都没留下…
展开
-
leetcode palindrome-number(判断一个数字是否是回文)
原题:Determine whether an integer is a palindrome. Do this without extra space. 题意:判断数字是否是回文 思路:和上一篇 reverse Integer很类似,设该数字位num,先取到该数字的位数(如果个位计为1,10位计为10,依此类推),高位数字可以由 num/位数获得,低位数字可以由num % 10获得,原创 2017-05-17 17:31:45 · 282 阅读 · 0 评论 -
leetcode reverse Integer(反转整数)
原题: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 反转一个整数,反转的过程不难,关键要注意几点 1. 当一个数字末尾为0时,反转后应该去掉。比如:1200000 反转后为 21. 2. 当一个整数超大不越界,但原创 2017-05-17 16:49:11 · 339 阅读 · 0 评论