标签:png turn code image rem 双指针 count remove bsp
双指针(广义)
class Solution { public: int removeElement(vector<int>& nums, int val) { int count = 0; int siz = nums.size(); for (int i = 0; i < siz; i++) { if (nums[i] != val) { nums[count++] = nums[i]; } } return count; } };
标签:png turn code image rem 双指针 count remove bsp
原文地址:https://www.cnblogs.com/tornado549/p/10029753.html