http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
class Solution {
public:
int removeDuplicates(int A[], int n) {
int current=0;
for(int i=0;i<n;i++){
if((i+2)<n&&A[i]==A[i+2]) continue;// Don't use A[i]==A[i-2], because A is changing
A[current++]=A[i];
}
return current;
}
};