![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
IndexTemp
这个作者很懒,什么都没留下…
展开
-
7. 反转整数
给定一个 32 位有符号整数,将整数中的数字进行反转。示例 1:输入: 123 输出: 321 示例 2:输入: -123 输出: -321 示例 3:输入: 120 输出: 21class Solution { public: int reverse(int x) { int result = 0; while (x) { ...原创 2018-05-08 21:24:44 · 188 阅读 · 0 评论 -
1、两数之和
两数之和给定一个整数数组和一个目标值,找出数组中和为目标值的两个数。你可以假设每个输入只对应一种答案,且同样的元素不能被重复利用。示例:给定 nums = [2, 7, 11, 15], target = 9 因为 nums[0] + nums[1] = 2 + 7 = 9 所以返回 [0, 1]解class Solution { public: vector<int> tw...原创 2018-05-08 12:26:24 · 297 阅读 · 0 评论