Tap here to switch tabs
Problem
Submissions

Problem: Count Elements With Maximum Frequency

Count Elements With Maximum Frequency asks you to find the highest frequency in an array, then return the total elements whose values occur that often.

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

Count Elements With Maximum Frequency asks you to find the highest frequency in an array, then return the total elements whose values occur that often.

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