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