You are given an array nums of positive integers. Return the total frequencies of elements in nums such that those elements all have the maximum frequency. The frequency of an element is the number of occurrences of that element in the array.
You are given an array nums of positive integers. Return the total frequencies of elements in nums such that those elements all have the maximum frequency. The frequency of an element is the number of occurrences of that element in the array.
Example 1:
Input: {"nums":[1,2,2,3,1,4]}
Output: 4
Constraints:
1≤nums.length≤100
1≤nums[i]≤100
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"nums":[1,2,2,3,1,4]}
Drop each number onto its own column. best is the tallest column so far, total counts the elements in all columns that tall.