1224. Maximum Equal Frequency
https://leetcode.com/problems/maximum-equal-frequency
Description
Given an array nums
of positive integers, return the longest possible length of an array prefix of nums
, such that it is possible to remove exactly one element from this prefix so that every number that has appeared in it will have the same number of occurrences.
If after removing one element there are no remaining elements, it's still considered that every appeared number has the same number of ocurrences (0).
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
2 <= nums.length <= 105
1 <= nums[i] <= 105
ac
Last updated