| 1 | class Solution { |
| 2 | public: |
| 3 | int removeElement(std::vector<int>& nums, int val) { |
| 4 | int k = 0; |
| 5 | |
| 6 | for (int i = 0; i < nums.size(); ++i) { |
| 7 | if (nums[i] != val) { |
| 8 | nums[k] = nums[i]; |
| 9 | ++k; |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | |
| 14 | return k; |
| 15 | } |
| 16 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected