上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 63 下一页
摘要: int cmp(const void* a,const void* b){ return *(int*)a-*(int*)b; } double trimMean(int* arr, int arrSize){ qsort(arr,arrSize,sizeof(int),cmp); int num= 阅读全文
posted @ 2020-11-09 11:47 温暖了寂寞 阅读(83) 评论(0) 推荐(0) 编辑
摘要: void recursion(struct TreeNode* root, int* minDeep, int curDeep){ curDeep++; if (curDeep>=*minDeep) return; if (!root->left && !root->right) { if (cur 阅读全文
posted @ 2020-11-09 11:37 温暖了寂寞 阅读(78) 评论(0) 推荐(0) 编辑
摘要: char * reorderSpaces(char * text){ int i,spaceNum=0,mid=0,end=0,wordNum=0; int len=strlen(text); for (i=0; i<len; i++){ if (text[i]==' ') { if (i!=0 & 阅读全文
posted @ 2020-11-09 10:42 温暖了寂寞 阅读(139) 评论(0) 推荐(0) 编辑
摘要: char slowestKey(int* releaseTimes, int releaseTimesSize, char * keysPressed){ int arr[][2]={keysPressed[0],releaseTimes[0]}; for (int i=1; i<releaseTi 阅读全文
posted @ 2020-11-09 09:23 温暖了寂寞 阅读(87) 评论(0) 推荐(0) 编辑
摘要: /** * Note: The returned array must be malloced, assume caller calls free(). */ typedef struct st{ int val; int cnt; }st; int cmp(const void* a,const 阅读全文
posted @ 2020-11-09 00:54 温暖了寂寞 阅读(250) 评论(0) 推荐(0) 编辑
摘要: int cmp(const void* a,const void* b){ return *(int*)a-*(int*)b; } int specialArray(int* nums, int numsSize){ qsort(nums,numsSize,sizeof(int),cmp); if( 阅读全文
posted @ 2020-11-08 22:21 温暖了寂寞 阅读(79) 评论(0) 推荐(0) 编辑
摘要: int numSpecial(int** mat, int matSize, int* matColSize){ int i,j,k,n,sum=0; int rows[100]={0}; int cols[100]={0}; for(i=0; i<matSize; i++) { for(j=0; 阅读全文
posted @ 2020-11-08 19:01 温暖了寂寞 阅读(136) 评论(0) 推荐(0) 编辑
摘要: int sumOddLengthSubarrays(int* arr, int arrSize){ int i,j,cnt,sum,total=0; for(i=0; i<arrSize; i++) { cnt=0; sum=0; for(j=i; j<arrSize; j++) { cnt++; 阅读全文
posted @ 2020-11-07 23:21 温暖了寂寞 阅读(112) 评论(0) 推荐(0) 编辑
摘要: char ** summaryRanges(int* nums, int numsSize, int* returnSize){ char** res=malloc(numsSize*sizeof(char*)); *returnSize=0; int p=0,q=0; while(q<numsSi 阅读全文
posted @ 2020-11-07 00:10 温暖了寂寞 阅读(54) 评论(0) 推荐(0) 编辑
摘要: bool recursion(int* target, int srcSize, int* src, int num, int pst){ int cnt=0,i; int oodpst=0,evenpst=srcSize/2; int arr[5001]={0}; if (srcSize<=num 阅读全文
posted @ 2020-11-06 19:41 温暖了寂寞 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 63 下一页