#C6438. Find the Most Popular Class Package
Find the Most Popular Class Package
Find the Most Popular Class Package
You are given a sequence of registration identifiers for class packages. Your task is to determine the most popular class package based on the number of registrations. In other words, find the identifier that occurs the most frequently in the list. If there are multiple identifiers with the same maximum frequency, choose the one that appears first in the list. If the list is empty, output (\text{None}).
For example, if the input is 9\nA1 B2 C3 A1 B2 A1 C3 A1 B2
, the output should be A1
because it occurs 4 times, which is more than any other identifier.
inputFormat
The first line contains an integer (N), the number of registration identifiers. The second line contains (N) space-separated strings representing the registration identifiers. (N) can be zero, in which case the list is empty.
outputFormat
Print the registration identifier with the maximum frequency. If there is a tie, output the one that appears first in the input order. If there are no identifiers, print (\text{None}).## sample
9
A1 B2 C3 A1 B2 A1 C3 A1 B2
A1
</p>