- 博客(3)
- 收藏
- 关注
原创 leetcode-121
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),
2016-04-13 01:32:50 159
原创 求杨辉三角的第n行
int* getRow(int rowIndex, int* returnSize) { if (rowIndex 0) return NULL; int *res = (int*)malloc(sizeof(int) * (rowIndex + 1)); for (int row = 0; row <= rowIndex; row++) for (int col = row
2016-04-13 01:20:38 3883
原创 leetcode
字符串转整数: version1 = 0; version1 = 10*version1 + (*v1 - '0'); v1存在的时候一直往后,从v[0]->v[n]。 找一个数组中出现n/2次以上的数 int majorityElement(int* nums, int numsSize) { int i,j,k,count=0; j=nums[0]; for
2016-04-11 23:27:34 162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人