Heap Sort


There is an array given containing integers. By implementing heap sort, sort the array elements.

Write a function solve that have the following parameter(s):
1.) arr = array of integers

Example
Input:
There is an array of integers given:
arr = [4,5,9,7,8]
Output:
The function will return,
[4, 5, 7, 8, 9]

Explanation
After sorting elements using heap sort, elements will be in order as 4,5,7,8,9.

Constraints
• Number of elements in the array will be greater than or equal to 1 and less than or equal to 600.
• Each element of the array will be greater than or equal to 1 and less than or equal to 10000.