input: Write a python function to sort an array using the insertion sort algorithm.
  assert insertionSort([2, 4, 7, 3, 8, 6, 1]) == [1, 2, 3, 4, 6, 7, 8]
  assert insertionSort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]
  assert insertionSort([20, 10, 30, 50, 40]) == [10, 20, 30, 40, 50]
  assert insertionSort([]) == []
  assert insertionSort([1]) == [1]
output: def insertionSort(arr):
      for i in range(1, len(arr)):
          key = arr[i]
          j = i - 1
          while j >= 0 and key < arr[j]:
              arr[j + 1] = arr[j]
              j -= 1
          arr[j + 1] = key
      return arr