Most easy one line inbuilt function in C++ code


#1

//using inbuilt CPP function
int Solution::removeDuplicates(vector &A) {
A.erase( unique( A.begin(), A.end() ), A.end() );
return A.size();
}


#2

Nice trick, thanks for the idea!