#include <bits/stdc++.h>
using namespace std;
int removeElement(vector<int>& nums, int val) {
int n = nums.size();
int j = 0;
for(int i = 0; i < n; i++){
if(nums[i] != val){
nums[j++] = nums[i];
}
}
return j;
}
int main() {
vector<int> nums(4);
nums[0] = 3;
nums[1] = 2;
nums[2] = 3;
nums[3] = 2;
int x = removeElement(nums, 3);
for(int i = 0 ; i < x; i++){
cout << nums[i] << " " ;
}
cout << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgcmVtb3ZlRWxlbWVudCh2ZWN0b3I8aW50PiYgbnVtcywgaW50IHZhbCkgewogICAgaW50IG4gPSBudW1zLnNpemUoKTsKICAgIGludCAgaiA9IDA7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKICAgICAgICBpZihudW1zW2ldICE9IHZhbCl7CiAgICAgICAgICAgIG51bXNbaisrXSA9IG51bXNbaV07CiAgICAgICAgfSAgICAKICAgIH0KICAgIHJldHVybiBqOwp9CgppbnQgbWFpbigpIHsKCXZlY3RvcjxpbnQ+IG51bXMoNCk7CgludW1zWzBdID0gMzsKCW51bXNbMV0gPSAyOwoJbnVtc1syXSA9IDM7CgludW1zWzNdID0gMjsKCWludCB4ID0gcmVtb3ZlRWxlbWVudChudW1zLCAzKTsKCWZvcihpbnQgaSA9IDAgOyBpIDwgeDsgaSsrKXsKCQljb3V0IDw8IG51bXNbaV0gPDwgIiAiIDsKIAl9CiAJY291dCA8PCBlbmRsOwoJcmV0dXJuIDA7Cn0=