标签:
water class Solution { public: int removeDuplicates(vector<int>& nums) { for(vector<int>::iterator it=nums.begin();it!=nums.end();) { int cur=*it; it++; while(it != nums.end() && *it == cur)nums.erase(it); } return nums.size(); } };
Leetcode026. Remove Duplicates from Sorted Array
标签:
原文地址:http://www.cnblogs.com/zeroArn/p/5874118.html