- 博客(3)
- 收藏
- 关注
原创 【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 195 1
原创 【Leetcode】Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321需要考虑的点是int类型的范围是-2147483648~2147483648.可能会出现溢出状况 ,这里使用longlong类型避免这种情况class Solution {public:
2017-04-05 16:29:35 191
原创 【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 195
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人