Sponsored
Use these hints if you're stuck. Try solving on your own first.
Find the tallest person and swap with the first person, then find the second tallest person and swap with the second person, etc. Repeat until you fix all n people.
Solve with full IDE support and test cases