`int* countBits(int num, int* returnSize) {`

int *ret = malloc(sizeof(int) * num+1);

returnSize = num+1;2) >= 1){

ret[0] = 0;

ret[1] = 1;

ret[2] = 1;

int i = 3;

int n2 = 2;

for(; i <= num; i++){

if(i / (n2

if(i == n2 * 2){

ret[i] = 1;

continue;

}else{

n2 *= 2;

}

}

ret[i] = ret[i - n2] + 1;;

}

return ret;

}