Simple C++ Solution using stl


#1

int Solution::removeDuplicates(vector &A) {

auto it=unique(A.begin(),A.end());
A.resize(distance(A.begin(),it));
return A.size();
}
Comment body goes here.