C++ 代码
class Solution {
public:
int getMissingNumber(vector<int>& nums) {
int size=nums.size();
if(size==0) return 0;
int t=0;
int i=0;
while(i<size){
if(nums[i]==t){
while(nums[i]==t) i++;
t++;
}
else{
break;
}
}
return t;
}
};