public int removeElement_lint(int[] A, int elem) {
        // write your code here
        int index = 0;
        for (int i = 0; i < A.length; ++i) {
            if (A[i] == elem)
                continue;
            A[index++] = A[i];
        }
        return index;
    }