上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 63 下一页
摘要: int countGoodTriplets(int* arr, int arrSize, int a, int b, int c){ int i, j, k, cnt=0; for(i=0; i<arrSize-2; i++){ for(j=i+1; j<arrSize-1; j++){ if(ab 阅读全文
posted @ 2020-11-24 17:31 温暖了寂寞 阅读(113) 评论(0) 推荐(0) 编辑
摘要: int countNegatives(int** grid, int gridSize, int* gridColSize){ int i, j, cnt=0; for(i=0; i<gridSize; i++){ for(j=0; j<gridColSize[i]; j++){ if(grid[i 阅读全文
posted @ 2020-11-24 12:32 温暖了寂寞 阅读(79) 评论(0) 推荐(0) 编辑
摘要: int countOdds(int low, int high){ return (high - low) / 2 + (low % 2 || high % 2); } 阅读全文
posted @ 2020-11-24 12:05 温暖了寂寞 阅读(112) 评论(0) 推荐(0) 编辑
摘要: int countPrimes(int n) { unsigned char *map = (unsigned char *)calloc(n, sizeof(unsigned char)); int sq = (int)sqrt(n); for (int i = 2; i <= sq; i++) 阅读全文
posted @ 2020-11-24 11:47 温暖了寂寞 阅读(64) 评论(0) 推荐(0) 编辑
摘要: void visitTree( struct TreeNode * t , struct TreeNode * form , int * x , int * y , int depth ){ if( t == NULL ){ return ; } if( t -> val == *x ){ *x = 阅读全文
posted @ 2020-11-24 11:20 温暖了寂寞 阅读(124) 评论(0) 推荐(0) 编辑
摘要: int minOperations(char ** logs, int logsSize){ int i, cnt=0; for(i=0; i<logsSize; i++){ if(isalnum(logs[i][0])) cnt++; else if(strcmp(logs[i],"../") = 阅读全文
posted @ 2020-11-24 10:07 温暖了寂寞 阅读(72) 评论(0) 推荐(0) 编辑
摘要: /** * Note: The returned array must be malloced, assume caller calls free(). */ int* createTargetArray(int* nums, int numsSize, int* index, int indexS 阅读全文
posted @ 2020-11-24 09:51 温暖了寂寞 阅读(63) 评论(0) 推荐(0) 编辑
摘要: int* diStringMatch(char * S, int* returnSize){ int i, j, len = strlen(S), minVal = 0, maxVal = len; int* arr = (int*)calloc(len + 1, sizeof(int)); for 阅读全文
posted @ 2020-11-24 00:50 温暖了寂寞 阅读(57) 评论(0) 推荐(0) 编辑
摘要: char * dayOfTheWeek(int day, int month, int year){ int i,j,days=0; char* weeks[]={"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "S 阅读全文
posted @ 2020-11-23 14:40 温暖了寂寞 阅读(92) 评论(0) 推荐(0) 编辑
摘要: int dayOfYear(char * date){ int day, year, month, sum=0; int monthArr[]={0,31,59,90,120,151,181,212,243,273,304,334,365}; sscanf(strtok(date,"-"), "%d 阅读全文
posted @ 2020-11-23 12:05 温暖了寂寞 阅读(68) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 63 下一页