![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
cuiyong_cn
这个作者很懒,什么都没留下…
展开
-
LeetCode-1 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...原创 2019-03-11 18:05:38 · 88 阅读 · 0 评论 -
Leetcode-3 Palindrome Number
文章目录问题解决方案问题判断一个整数是否是回文.(跟汉字回文一样, 正反一样).限制: 不将数字转为字符串.例子:Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanation: From left to right, it reads -121. From right to left...原创 2019-03-22 11:55:40 · 142 阅读 · 0 评论 -
Leetcode-2 Reverse Integer
文章目录描述解决方案描述给一个32位有符号的整数, 将其数字翻转, 如果翻转后的数字溢出, 返回0. 例子:Input: 123Output: 321Input: -123Output: -321Input: 120Output: 21解决方案利用栈的操作原理, 代码如下:class Solution {public: int reverse(int x) {...原创 2019-03-18 23:23:09 · 118 阅读 · 0 评论