Question: Implementation in python 3.9.1 . F. Equalize the Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output

Implementation in python 3.9.1
. F. Equalize the Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp was gifted an array a of length 1. Polycarp considers an array beautiful if there exists a number C such that each number in the array occurs either zero or C times. Polycarp wants to remove some elements from the array a to make it beautiful. For example, if n = 6 and a = [1, 3, 2, 1, 4, 2], then the following options are possible to make the array a array beautiful: Polycarp removes elements at positions 2 and 5 array a becomes equal to 1, 2, 1, 2]; Polycarp removes elements at positions 1 and 6 array a becomes equal to 3, 2, 1, 4); Polycarp removes elements at positions 1, 2 and 6 array a becomes equal to 2, 1, 4); Help Polycarp determine the minimum number of elements to remove from the array a to make it beautiful. Input The first line contains one integert (1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
