class Solution {
public int missingNumber(int[] nums) {
Arrays.sort(nums);
int i =0;
for( i = 0;i < nums.length + 1;i++){
if(i == nums.length){
return i;
}
if(i != nums[i]){
break;
}
}
return i;
}
}
03-05
142
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)