Two Maximum Frequencies 1

Write a function @def max2freq@ that receives as argument a list of
words, and finds in it both the words that appear with maximum frequency
and the words that appear with second maximum frequency.

Input is received as argument of the function: it is an arbitrary list
of strings. The result returned by the function must be a pair formed by
two lists. The first list contains the words that appear with maximum
frequency in the input, sorted according to their standard Python
ordering. The second list contains the words that appear with second
maximum frequency in the input, sorted likewise. Think carefully whether
each of the output lists can be empty.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T13:44:03.957Z

© Jutge.org, 2006–2026.
https://jutge.org
