input: Write a python function to perform heap sort on a list of integers.
  assert heapSort([8, 5, 2, 1, 8]) == [1, 2, 5, 8, 8]
  assert heapSort([3, 1, 4, 1, 5, 9, 2, 6, 5]) == [1, 1, 2, 3, 4, 5, 5, 6, 9]
  assert heapSort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]
output: def heapSort(arr):
      def heapify(arr, n, i):
          largest = i
          left = 2 * i + 1
          right = 2 * i + 2
  
          if left < n and arr[i] < arr[left]:
              largest = left
  
          if right < n and arr[largest] < arr[right]:
              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