Guest User

Untitled

a guest
Jul 17th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. int mostFrequent(vector<int>nums) {
  2. int answer = INT_MIN;
  3. map<int,int> hash;
  4. for(int i = 0; i < nums.size(); i++){
  5. answer = max(answer, ++hash[nums[i]]);
  6. }
  7. return answer;
  8. }
Add Comment
Please, Sign In to add comment