--- class Solution { public: int getMissingNumber(vector<int>& nums) { int res = 0 ; for(int i : nums) { if(res + 1 == i || res != i) break; res ++ ; } return res ; } }; ---