可以用二分优化
address
int missingNumber(int* nums, int numsSize){
int guiwei(int shu){
int a= nums[shu];
nums[shu] = shu;
if((a>=0)&&(a<numsSize))
guiwei(a);
return a;
}
for(int i = 0; i< numsSize; i++){
if(nums[i] != i){
if((nums[i]>=0)&&(nums[i]<numsSize))
guiwei(nums[i]);
}
}
for(int i = 0; i< numsSize; i++){
if(nums[i] != i)
return i;
}
return numsSize;
}