标签:
1 class Solution 2 { 3 public: 4 int removeElement(vector<int>& nums, int val) 5 { 6 int len = nums.size(); 7 int i = 0; 8 while(i < len) 9 nums[i] == val? (nums[i] = nums[--len]): ++i; 10 return len; 11 } 12 };
https://leetcode.com/problems/remove-element/
标签:
原文地址:http://www.cnblogs.com/daijkstra/p/4520192.html