摘要: 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 阅读全文
posted @ 2017-02-11 23:59 王坤1993 阅读(125) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int removeDuplicates(int A[], int n) { if (n <= 1) return n; int pre = 0, cur = 0; while (cur < n) { if (A[cur] == A[pre]) ++ 阅读全文
posted @ 2017-02-11 23:57 王坤1993 阅读(91) 评论(0) 推荐(0) 编辑