摘要: int removeDuplicates(int* nums, int numsSize){ int cnt = 0; for (int i = 0; i<numsSize; i++) if (cnt<2 || nums[i]>nums[cnt - 2]) nums[cnt++] = nums[i] 阅读全文
posted @ 2020-12-12 23:35 温暖了寂寞 阅读(70) 评论(0) 推荐(0)
摘要: bool dfs(char** board, int boardSize, int ColSize, char * word, int r, int c, int cnt,int len){ if (r < 0 || r >= boardSize || c < 0 || c >= ColSize | 阅读全文
posted @ 2020-12-12 22:13 温暖了寂寞 阅读(84) 评论(0) 推荐(0)
摘要: int** subsets(int* nums, int numsSize, int* returnSize, int** returnColumnSizes) { int** ans = malloc(sizeof(int*) * (1 << numsSize)); *returnColumnSi 阅读全文
posted @ 2020-12-12 20:14 温暖了寂寞 阅读(84) 评论(0) 推荐(0)
摘要: void recursion(int n, int k, int* returnSize, int* col,int* temp,int cnt,int** arr,int start){ if(cnt==k){ arr[(*returnSize)]=(int*)calloc(k,sizeof(in 阅读全文
posted @ 2020-12-12 17:51 温暖了寂寞 阅读(83) 评论(0) 推荐(0)
摘要: void swap(int *a, int *b) { int t = *a; *a = *b, *b = t; } void sortColors(int *nums, int numsSize) { int p0 = 0, p1 = 0; for (int i = 0; i < numsSize 阅读全文
posted @ 2020-12-12 15:09 温暖了寂寞 阅读(83) 评论(0) 推荐(0)
摘要: bool searchMatrix(int** matrix, int matrixSize, int* matrixColSize, int target){ if(matrixSize==0 || *matrixColSize==0) return false; int i, left=0, r 阅读全文
posted @ 2020-12-12 09:55 温暖了寂寞 阅读(89) 评论(0) 推荐(0)
摘要: void setZeroes(int** matrix, int matrixSize, int* matrixColSize){ int* rhash = (int*)calloc(matrixSize, sizeof(int)); int* chash = (int*)calloc(*matri 阅读全文
posted @ 2020-12-12 00:05 温暖了寂寞 阅读(132) 评论(0) 推荐(0)