标签:rem code pre res tor val ++i class element
class Solution { public: int removeElement(vector<int>& nums, int val) { int res = 0; for (int i = 0; i < nums.size(); ++i) { if (nums[i] != val) nums[res++] = nums[i]; } return res; } };
标签:rem code pre res tor val ++i class element
原文地址:http://www.cnblogs.com/wangkun1993/p/6390314.html