摘要: #define MAX_SIZE 50000 void transfer_bitree(struct TreeNode* t, char *s, int *len) { if (t) { *len += sprintf(s + *len, "%d", t->val); if (t->left || 阅读全文
posted @ 2020-11-26 23:07 温暖了寂寞 阅读(113) 评论(0) 推荐(0) 编辑
摘要: /** * Note: The returned array must be malloced, assume caller calls free(). */ int* constructRectangle(int area, int* returnSize){ int* arr = (int*)c 阅读全文
posted @ 2020-11-26 20:19 温暖了寂寞 阅读(49) 评论(0) 推荐(0) 编辑
摘要: //结构体存放数组元素的下标和值,接着快排,最后再逐个比较 typedef struct { int index; int val; }st; int cmp(const void* a, const void* b){ return ((*(st*)a).val != (*(st*)b).val) 阅读全文
posted @ 2020-11-26 16:57 温暖了寂寞 阅读(87) 评论(0) 推荐(0) 编辑
摘要: int countLargestGroup(int n){ int hash[37]={0}; int map[10001]={0}; int i, sum, tmp, max=0, cnt=0; for(i=1; i<=n; i++){ map[i]=map[i/10]+i%10; hash[ma 阅读全文
posted @ 2020-11-26 12:41 温暖了寂寞 阅读(119) 评论(0) 推荐(0) 编辑