Loading...
Loading...
Loading...
A company lists its staff with their salaries. Print the names from the highest salary to the lowest. People with the same salary keep the order in which they were listed.
Example 1
Input
3 Asha 50 Ravi 70 Lena 50
Output
Ravi Asha Lena
Example 2
Input
2 Omar 90 Zoya 90
Output
Omar Zoya
Try the problem first. Open one hint at a time.
A stable sort keeps equal items in input order.
Python sorts are stable, even with reverse=True.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor