上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 63 下一页
摘要: int Mycmp( const void * a , const void * b){ int i = 0 , j = 0; char * s1 = *( ( char ** ) a ); char * s2 = *( ( char ** ) b ); while( *( s1 + i++ ) ! 阅读全文
posted @ 2020-09-08 17:14 温暖了寂寞 阅读(161) 评论(0) 推荐(0) 编辑
摘要: bool repeatedSubstringPattern(char* s) { int n = strlen(s); char k[2 * 10000 + 1]; k[0] = 0; strcat(k, s); strcat(k, s); return strstr(k + 1, s) - k ! 阅读全文
posted @ 2020-09-08 11:57 温暖了寂寞 阅读(93) 评论(0) 推荐(0) 编辑
摘要: char * modifyString(char * s){ int len=strlen(s); for(int i=0;i<len;i++){ char ch; for(ch='a';ch<'z';ch++){ if(s[i]=='?' && i>=1){ if(ch==s[i-1] || ch 阅读全文
posted @ 2020-09-08 10:05 温暖了寂寞 阅读(328) 评论(0) 推荐(0) 编辑
摘要: int* replaceElements(int* arr, int arrSize, int* returnSize){ *returnSize=arrSize; int i,MaxVal=-1,staybefor; for(i=arrSize-1; i>-1 ;i--) //从后往前遍历 每次比 阅读全文
posted @ 2020-09-08 09:27 温暖了寂寞 阅读(114) 评论(0) 推荐(0) 编辑
摘要: int** matrixReshape(int** nums, int numsSize, int* numsColSize, int r, int c, int* returnSize, int** returnColumnSizes){ if (r*c != numsSize*(*numsCol 阅读全文
posted @ 2020-09-08 08:40 温暖了寂寞 阅读(161) 评论(0) 推荐(0) 编辑
摘要: uint32_t reverseBits(uint32_t n) { int arr[32] = {0}; int i=0; while(n) { arr[i++] = n % 2; n /= 2; } for(i=0; i<32; i++) { n += (arr[i])? pow(2,32-1- 阅读全文
posted @ 2020-09-07 23:58 温暖了寂寞 阅读(119) 评论(0) 推荐(0) 编辑
摘要: int reverseBits(int num){ int max = 0,cnt = 0,cntPre = 0; while(num) { if(1 & num) cnt++; else { if(cntPre + cnt + 1 > max) max = cntPre + cnt + 1; cn 阅读全文
posted @ 2020-09-07 19:57 温暖了寂寞 阅读(165) 评论(0) 推荐(0) 编辑
摘要: void reverseString(char* s, int sSize){ int start =0,end = sSize-1,temp; while(start < end) temp = s[start],s[start++] = s[end],s[end--] = temp; } 阅读全文
posted @ 2020-09-07 18:24 温暖了寂寞 阅读(117) 评论(0) 推荐(0) 编辑
摘要: char * reverseStr(char * s, int k){ int len = strlen(s); for (int i = 0; i < len; i += 2 * k) { int left = i; int right = (i + k - 1 < len) ? i + k - 阅读全文
posted @ 2020-09-07 16:10 温暖了寂寞 阅读(98) 评论(0) 推荐(0) 编辑
摘要: char * reverseVowels(char * s){ char vowels[6] = {'a', 'e', 'i', 'o', 'u'}; int i = 0, j = strlen(s) - 1; char t; while (i < j){ if (strchr(vowels, to 阅读全文
posted @ 2020-09-07 14:41 温暖了寂寞 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 63 下一页