LeetCode
...10214
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode OJ1
/** * Note: The returned array must be malloced, assume caller calls free(). */ int* twoSum(int* nums, int numsSize, int target) { int i,j,left; int *answer = (int *)malloc(sizeof(int)原创 2017-07-27 14:56:14 · 369 阅读 · 0 评论 -
LeetCode OJ8
int myAtoi(char* str) { char *s = str; while (*s && isspace(*s)) s++; //去除空格 int n = 0; if (*s) { int sign = 1; if (*s == '+')原创 2017-07-27 15:32:39 · 395 阅读 · 0 评论 -
LeetCode OJ7
int reverse(int x) { long long val=0; do { val=val*10+x%10; x=x/10; }while(x); return (val>INT_MAX||val } 此题主要在于如何处理数字顺序颠倒产生的overflow问题 通过将原创 2017-07-27 15:49:49 · 334 阅读 · 0 评论 -
LeetCode OJ9
bool isPalindrome(int x) { if(x if(x int y = 0; int tmp = x; while(tmp) { y = y * 10 + (tmp % 10); tmp /= 10; } return x == y; }原创 2017-07-27 16:20:35 · 349 阅读 · 0 评论
分享