上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 63 下一页
摘要: char* replaceSpaces(char* S, int length){ char* s = (char*)calloc(length*3+1,sizeof(char)); int n = 0; for (int i=0; i<length; i++) { if (S[i] == ' ') 阅读全文
posted @ 2020-09-04 11:33 温暖了寂寞 阅读(114) 评论(0) 推荐(0) 编辑
摘要: bool checkRecord(char * s){ int Acount = 0; int Lcount = 0; for (int i=0; i<strlen(s); i++) { if (s[i] == 'A') { Acount++; if (Acount > 1) return fals 阅读全文
posted @ 2020-09-04 11:15 温暖了寂寞 阅读(154) 评论(0) 推荐(0) 编辑
摘要: char ** subdomainVisits(char ** cpdomains, int cpdomainsSize, int* returnSize){ char** arr = (char**)calloc(1000,sizeof(char*)); int* hash = (int*)cal 阅读全文
posted @ 2020-09-03 16:55 温暖了寂寞 阅读(190) 评论(0) 推荐(0) 编辑
摘要: int subtractProductAndSum(int n) { int add = 0, mul = 1; while (n > 0) { int digit = n % 10; n /= 10; add += digit; mul *= digit; } return mul - add; 阅读全文
posted @ 2020-09-03 14:45 温暖了寂寞 阅读(155) 评论(0) 推荐(0) 编辑
摘要: bool func(struct TreeNode* s, struct TreeNode* t) { if (!s && !t) return true; else if (!s || !t) return false; else if (s->val != t->val) return fals 阅读全文
posted @ 2020-09-03 14:26 温暖了寂寞 阅读(102) 评论(0) 推荐(0) 编辑
摘要: int* sumEvenAfterQueries(int* A, int ASize, int** queries, int queriesSize, int* queriesColSize, int* returnSize){ int* answer = (int*)calloc(queriesS 阅读全文
posted @ 2020-09-03 11:34 温暖了寂寞 阅读(126) 评论(0) 推荐(0) 编辑
摘要: void SumLeftNode(struct TreeNode* root,int* sum,int flag) { if (!root) return; if (flag && !root->left && !root->right) *sum += root->val; SumLeftNode 阅读全文
posted @ 2020-09-03 10:22 温暖了寂寞 阅读(133) 评论(0) 推荐(0) 编辑
摘要: void trans(struct TreeNode* root, int cur, int *sum) { if (root == NULL) { return; } cur = cur * 2 + root->val; if (root->left == NULL && root->right 阅读全文
posted @ 2020-09-03 09:54 温暖了寂寞 阅读(115) 评论(0) 推荐(0) 编辑
摘要: bool judgeSquareSum(int c){ long long n = 0; while(n*n < c)n++; if (n*n == c)return true; long long i = n - 1; long long j = 1; while(i>=j) { while(i> 阅读全文
posted @ 2020-09-02 19:22 温暖了寂寞 阅读(139) 评论(0) 推荐(0) 编辑
摘要: int surfaceArea(int** grid, int gridSize, int* gridColSize){ int i, j, k, res = 0; for(i=0; i<gridSize; i++){ for(j=0; j<gridColSize[i]; j++){ for(k=0 阅读全文
posted @ 2020-09-02 18:27 温暖了寂寞 阅读(148) 评论(0) 推荐(0) 编辑
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 63 下一页