#include "s0027_remove_element.hpp" int S0027::removeElement(vector& nums, int val) { int len = nums.size(); int f{0}, s{0}; while (f < len) { if (nums[f] != val) { nums[s] = nums[f]; ++s; } ++f; } return s; }