class Solution {
public:
int removeElement(vector<int>& nums, int val) {
if(nums.size() == 0) {
return 0;
}
int fast=0,slow=0;
while(fast < nums.size()) {
if(nums[fast] != val) {
nums[slow] = nums[fast];
slow++;
}
fast++;
}
return slow;
}
};