Similar with the solutions of "https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/".

class Solution {

public:

int missingNumber(vector<int>& nums) {

```
nums.push_back(1); // adding one element for indicating 'n'
for (auto &val: nums) ++val;
for (auto i=0; i<nums.size()-1; ++i){
auto index = nums[i];
nums[abs(index)-1] *= -1;
}
for (auto i=0; i<nums.size(); ++i)
{
if (nums[i]>0) return i;
}
return -1;
}
```

};