摘要:
/** * Note: The returned array must be malloced, assume caller calls free(). */ int* constructRectangle(int area, int* returnSize){ int* arr = (int*)c 阅读全文
摘要:
//结构体存放数组元素的下标和值,接着快排,最后再逐个比较 typedef struct { int index; int val; }st; int cmp(const void* a, const void* b){ return ((*(st*)a).val != (*(st*)b).val) 阅读全文
摘要:
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 阅读全文