#include "s0027_remove_element.hpp" int Solution::removeElement(vector& nums, int val) { int size = nums.size(); if (size == 0) { return 0; } int fast{0}, slow{0}; for (; fast < size; ++fast) { if (nums.at(fast) == val) { continue; } else { nums[slow] = nums.at(fast); ++slow; } } return slow; }