Implement an in-place heap sort that returns a sorted list from any list of comparable elements.
Constraints
Example
>>> heap_sort([3, 1, 2]) [1, 2, 3] >>> heap_sort([5, 5, 5, 1]) [1, 5, 5, 5] >>> heap_sort([]) []
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints