#include using namespace std; class Solution { public: int removeElement(vector &nums, int val) { int count = 0; for (int i = 0; i < nums.size(); i++) { if (nums[i] != val) { nums[count++] = nums[i]; } } return count; } };