Tap here to switch tabs
Problem
Submissions

Problem: Maximum Equal Frequency

med
30 min
Try to solve the Maximum Equal Frequency problem.

Statement

Given an array of positive integers nums, find the maximum length of a prefix such that removing exactly 11 element results in every remaining integer in that prefix having the same frequency of occurrence.

Constraints:

  • 2≤2 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Equal Frequency

med
30 min
Try to solve the Maximum Equal Frequency problem.

Statement

Given an array of positive integers nums, find the maximum length of a prefix such that removing exactly 11 element results in every remaining integer in that prefix having the same frequency of occurrence.

Constraints:

  • 2≤2 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5