C++ 代码
class Solution {
public:
int getMissingNumber(vector<int>& nums) {
int n = 0;
for(int x:nums)
{
if(x!=n)
{
return n;
}
n++;
}
return n;
}
};