Hello, dear users! Below you can see a simple way of solving this problem using binary XOR operator.

```
int missingNumber(vector<int>& nums) {
int x = 0;
for (int i = 0; i < nums.size() + 1; i++)
x ^= i;
for (int i = 0; i < nums.size(); i++)
x ^= nums[i];
return x;
}
```