input: Write a python function to insert an element into a sorted array using insertion sort.
  assert insertSort([1, 2, 4, 5], 3) == [1, 2, 3, 4, 5]
  assert insertSort([10, 20, 30, 50], 40) == [10, 20, 30, 40, 50]
  assert insertSort([5, 7, 9, 11], 8) == [5, 7, 8, 9, 11]
output: def insertSort(arr, elem):
      arr.append(elem)
      i = len(arr) - 1
      while i > 0 and arr[i-1] > arr[i]:
          arr[i], arr[i-1] = arr[i-1], arr[i]
          i -= 1
      return arr