Remove Duplicates from Sorted Array
使用快慢指针标记重复元素:https://www.cnblogs.com/grandyang/p/4329128.html
一个比较简洁的c++解法:
int count = 0;
for(int i = 1; i < n; i++){
if(A[i] == A[i-1]) count++;
else A[i-count] = A[i];
}
return n-count;
相似的问题:
https://leetcode.com/problems/remove-element/description/