Top Scores
results has columns name and score. Return the n highest scores as a list, biggest first. Repeated scores can appear more than once.
Example 1
results {"name":["a","b","c","d"],"score":[50,90,70,90]}
n 3
returns [90,90,70]
The three biggest are 90, 90 and 70.
Constraints
1 <= n <= number of rows
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Upper QuartileBeginner
- Wanted StatusesBeginner
- Add Total ColumnEasy
- All Emails OnceEasy
- Biggest Single NumberEasy
- Cheapest ItemEasy
- Classes With Many StudentsEasy
- Columns With GapsEasy