摘要: 假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−231, 231 − 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。 代码如下: 1 int reverse(int x) { 2 int temp = x, num = 0; 3 while (x) { 4 if (n 阅读全文
posted @ 2019-03-09 16:35 Lee先森的博客 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 代码如下: 1 /** 2 * Note: The returned array must be malloced, assume caller calls free(). 3 */ 4 int* twoSum(int* nums, int numsSize, int target) { 5 sta 阅读全文
posted @ 2019-03-09 16:27 Lee先森的博客 阅读(268) 评论(0) 推荐(0) 编辑