二分法
class Solution {
public:
int getMissingNumber(vector<int>& nums) {
int l = 0;
int r = nums.size()-1;
while(l<r){
int mid = (l+r)>>1;
if(nums[mid]==mid) l = mid+1;
else r = mid;
}
if(nums[r] = r) r++; // 特判是n的情况
return r;
}
};