Two Maximum Frequencies 2

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

Input is received as argument of the function: it is an arbitrary list
of integer values. The result returned by the function must be a pair
formed by two lists. The first list contains the values that appear with
maximum frequency in the input, ordered increasingly. The second list
contains the values that appear with second maximum frequency in the
input, also ordered increasingly. Think carefully whether each of the
output lists can be empty.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T16:50:52.353Z

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