上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 63 下一页
摘要: 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 温暖了寂寞 阅读(67) 评论(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 温暖了寂寞 阅读(75) 评论(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 温暖了寂寞 阅读(74) 评论(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 温暖了寂寞 阅读(77) 评论(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 温暖了寂寞 阅读(75) 评论(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 温暖了寂寞 阅读(83) 评论(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 温暖了寂寞 阅读(121) 评论(0) 推荐(0) 编辑
摘要: char * simplifyPath(char * path){ char *stack[100]; int size = 0; for (char *s = strtok(path, "/"); s; s = strtok(NULL, "/")) { if (strcmp(s, ".") == 阅读全文
posted @ 2020-12-11 21:29 温暖了寂寞 阅读(85) 评论(0) 推荐(0) 编辑
摘要: #define min(a,b) ((a)<(b))?(a):(b); int minPathSum(int** grid, int gridSize, int* gridColSize){ for (int i=gridSize-1; i>=0; i--){ for (int j=(*gridCo 阅读全文
posted @ 2020-12-11 17:43 温暖了寂寞 阅读(84) 评论(0) 推荐(0) 编辑
摘要: int uniquePathsWithObstacles(int** obstacleGrid, int obstacleGridSize, int* obstacleGridColSize){ double* arr=(double*)calloc(*obstacleGridColSize,siz 阅读全文
posted @ 2020-12-11 16:26 温暖了寂寞 阅读(79) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 63 下一页