摘要:
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 阅读全文
摘要:
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]) ++ 阅读全文