#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int slowIndex = 0;
for (int fastIndex = 0; fastIndex < nums.size(); fastIndex++) {
if (val != nums[fastIndex]) {
nums[slowIndex++] = nums[fastIndex];
}
}
return slowIndex;
}
};
int main() {
vector<int> vec{1,4,3,1,5,76,1,5};
Solution s;
s.removeElement(vec,3);
for (int i = 0; i < vec.size()-1; i++) {
cout << vec[i]<<endl;
}
}