Mode Finder

Medium
statistics Capital One Two Sigma

Find all modes (most frequently occurring values) in a list of numbers. Return them sorted in ascending order.

Example

find_modes([1, 2, 2, 3, 3, 4])
# => [2, 3]
find_modes([1, 1, 1, 2])
# => [1]

Test Cases

Python Editor

Output

Click "Run" to see results...