摘要: int projectionArea(int** grid, int gridSize, int* gridColSize){ int sum=0,i,j,count=0; int colMax[51] = {0}; int rowMax[51] = {0}; for (i=0; i<gridSiz 阅读全文
posted @ 2020-09-10 19:20 温暖了寂寞 阅读(165) 评论(0) 推荐(0) 编辑
摘要: int maxCount(int m, int n, int** ops, int opsSize, int* opsColSize){ for (int i=0; i<opsSize; i++) { if (ops[i][0] < m) m = ops[i][0]; if (ops[i][1] < 阅读全文
posted @ 2020-09-10 18:17 温暖了寂寞 阅读(129) 评论(0) 推荐(0) 编辑
摘要: typedef int NumArray; NumArray* numArrayCreate(int* nums, int numsSize) { for (int i = 1; i < numsSize; i++) { nums[i] += nums[i - 1]; } return nums; 阅读全文
posted @ 2020-09-10 17:47 温暖了寂寞 阅读(101) 评论(0) 推荐(0) 编辑
摘要: int rangeSumBST(struct TreeNode* root, int L, int R){ if (!root) return 0; if (root->val < L) return rangeSumBST(root->right,L,R); if (root->val > R) 阅读全文
posted @ 2020-09-10 15:47 温暖了寂寞 阅读(121) 评论(0) 推荐(0) 编辑
摘要: typedef struct{ int val; int index; }st; int cmp(const void* a, const void* b){ return ((st*)a)->val - ((st*)b)->val; } int* arrayRankTransform(int* a 阅读全文
posted @ 2020-09-10 15:17 温暖了寂寞 阅读(203) 评论(0) 推荐(0) 编辑
摘要: bool canConstruct(char * ransomNote, char * magazine){ int hash[26] = {0},i; for (i=0; magazine[i] != '\0'; i++) { hash[magazine[i]-97]++; } for (i=0; 阅读全文
posted @ 2020-09-10 14:10 温暖了寂寞 阅读(117) 评论(0) 推荐(0) 编辑
摘要: bool isRectangleOverlap(int* rec1, int rec1Size, int* rec2, int rec2Size){ return (rec2[0] < rec1[2] && rec2[1] < rec1[3] && rec2[2] > rec1[0] && rec2 阅读全文
posted @ 2020-09-10 13:37 温暖了寂寞 阅读(139) 评论(0) 推荐(0) 编辑
摘要: char * reformatDate(char * date){ int len = strlen(date); int i,j=0; char* str = (char*)calloc(len*2,sizeof(char)); char* arr[] = {"Jan","01","Feb","0 阅读全文
posted @ 2020-09-10 10:29 温暖了寂寞 阅读(223) 评论(0) 推荐(0) 编辑
摘要: char * reformat(char * s){ int alpha = 0,digit = 0,dindex,aindex,i; int len = strlen(s); char* str = (char*)calloc(len*2+1,sizeof(char)); for(i=0; i<l 阅读全文
posted @ 2020-09-10 09:05 温暖了寂寞 阅读(203) 评论(0) 推荐(0) 编辑