https://oj.leetcode.com/problems/remove-element/
简单处理
class Solution { public: int removeElement(int A[], int n, int elem) { if(n == 0) return n; int pos = 0; for(int i = 0; i < n; i++) { if(A[i] == elem) continue; else { if(i != pos) { A[pos] = A[i]; } pos++; } } return pos; } };