input: Write a python function to perform heap sort on a list of integers.
  assert heapSort([12, 11, 13, 5, 6, 7]) == [5, 6, 7, 11, 12, 13]
  assert heapSort([4, 10, 3, 5, 1]) == [1, 3, 4, 5, 10]
  assert heapSort([20, 18, 12, 8, 10, 5, 15, 7]) == [5, 7, 8, 10, 12, 15, 18, 20]
output: def heapSort(arr):
      def heapify(arr, n, i):
          largest = i
          left = 2 * i + 1
          right = 2 * i + 2
          
          if left < n and arr[left] > arr[largest]:
              largest = left
              
          if right < n and arr[right] > arr[largest]:
              largest = right
              
          if largest != i:
              arr[i], arr[largest] = arr[largest], arr[i]
              heapify(arr, n, largest)
      
      n = len(arr)
      
      for i in range(n // 2 - 1, -1, -1):
          heapify(arr, n, i)
          
      for i in range(n - 1, 0, -1):
          arr[i], arr[0] = arr[0], arr[i]
          heapify(arr, i, 0)
      
      return arr