Without map using pointer


#1

vector Solution::solve(vector &A) {
vector res;
for(int i=0;i<A.size();i++){
auto it=find(res.begin(),res.end(),A[i]);
if(it!=res.end()){
(*it)++;
res.push_back(A[i]);
}
else{
res.push_back(A[i]);
}
}
return res;
}