Tap here to switch tabs
Problem
Submissions

Problem: Count Elements With Maximum Frequency

med
30 min
Try to solve the Count Elements With Maximum Frequency problem.

Statement

Given an integer array nums, compute the frequency of each distinct value. Let the maximum frequency among all values be the largest count of any value in nums. Return the total number of elements in nums whose values occur with this maximum frequency.

Note: The returned value is the sum of frequencies of all distinct values that tie for the maximum frequency.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Elements With Maximum Frequency

med
30 min
Try to solve the Count Elements With Maximum Frequency problem.

Statement

Given an integer array nums, compute the frequency of each distinct value. Let the maximum frequency among all values be the largest count of any value in nums. Return the total number of elements in nums whose values occur with this maximum frequency.

Note: The returned value is the sum of frequencies of all distinct values that tie for the maximum frequency.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100