![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
zchunle
这个作者很懒,什么都没留下…
展开
-
【Leetcode】two sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the sam原创 2017-04-05 14:52:55 · 191 阅读 · 0 评论 -
【Leetcode】Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 需要考虑的点是int类型的范围是-2147483648~2147483648.可能会出现溢出状况 ,这里使用longlong类型避免这种情况 class Solution { public:原创 2017-04-05 16:29:35 · 187 阅读 · 0 评论 -
【Leetcode】Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. 回文就是左右颠倒之后还是一样的。不能用reverse integer的方法 ,可能会造成溢出的情况。使用除法和取余的方法。 class Solution { public: bool isPalindrome(int x) {原创 2017-04-05 17:45:00 · 189 阅读 · 1 评论