```
class Solution {
public:
vector<int> findDisappearedNumbers ( vector<int>& nums ) {
vector<int> temp(nums.size(),0);
for ( size_t i = 0; i < nums.size ( ); i++ )
{
temp[nums[i]-1]++;
}
int j = 0;
for ( size_t i = 0; i < temp.size ( ); i++ )
{
if ( temp [ i ] == 0 )
{
nums [ j ] = i + 1;
j++;
}
}
for ( size_t i = j; i < temp.size(); i++ )
{
nums.pop_back ( );
}
return nums;
}
};
```