Solved LeetCode program · 186 of 1,000
#0215 · Kth Largest Element in an Array
Original English source
The numbers is a list of 3, 2, 1, 5, 6, and 4. The rank is 2. The last is the last position of numbers.
For every left from 0 to last.
For every right from left plus 1 to last.
If item right of numbers is more than item left of numbers, swap item left of numbers and item right of numbers.
The spot is rank minus 1. Show item spot of numbers.
Expected stdout
5