```
int removeDuplicates(vector<int>& nums) {
int front = 0;
for(int i = 0; i < nums.size(); ++i) {
while(nums[i+1] == nums[i]) {++i;}
nums[front++] = nums[i];
}
return front;
}
```

It runs through the vector and grabs the last one in any given run of numbers.

Luckily, it didn't have to deal with out-of-bounds errors, but a quick check and return if EOF is sufficient