C++ || simple solution

int Solution::solve(vector<int> &A) {
map<int,int>mp;
int ans=0;
for(int i=0;i<A.size();i++){
    mp[A[i]]++;
    ans=max(mp[A[i]],ans);
}
return ans;

}

Click here to start solving coding interview questions