```
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
vector<int>::iterator iter = find(nums.begin(), nums.end(), val);
int count = 0;
while(iter != nums.end()) {
nums.erase(iter);
iter = find(nums.begin(), nums.end(), val);
count ++;
}
return count;
}
};
the input and output like this:
Input:
[1], 1
Output:
[1]
Expected:
[]
```