Frequency Leaders

Sometimes you need more than a frequency table — you need to know which values are tied for first place. Given a list arr, count how many times each value appears and return all values with the highest frequency. The returned list must be sorted in ascending order.

Примеры

Ввод
[[1, 1, 2, 2, 3]]
Вывод
[1, 2]
Ввод
[[1, 2, 3, 324, 234, 23, 23, 1, 23, 23]]
Вывод
[23]
Ввод
[[5]]
Вывод
[5]

Нужно реализовать

def top_1(arr: list[int]) -> list[int]:

Теги

arrayhashmap
PostgreSQLv16
Entre para enviar

O resultado da execução do código aparecerá aqui

Visible tests
1
Input
[1,1,2,2,3]
Expected[1,2]
2
Input
[1,2,3,324,234,23,23,1,23,23]
Expected[23]
3
Input
[5]
Expected[5]
4
Input
[4,4,5,5]
Expected[4,5]
5
Input
[1,2,3,324,234]
Expected[1,2,3,234,324]
6
Input
[1]
Expected[1]
Focus radio
Paused · SomaFM · Fluid