Hi, The solution provided is buggy. Try {10 8 4 6 5} to see it. An alternative solution is actually quite simple. 1. sort the array. 2. return the largest n entries.
Hi,
The solution provided is buggy. Try {10 8 4 6 5} to see it.
An alternative solution is actually quite simple.