先排后找可以让结果更简单
int cmp(const void* a, const void* b){
return *(int*)a - *(int*)b;
}
int missingNumber(int* nums, int numsSize){
qsort(nums, numsSize, 4, cmp);
for(int i=0; i<numsSize; ++i){
if(nums[i] == i){
continue;
}else{
return i;
}
}
return numsSize;
}