input: def insertion_sort(arr: List[int]) -> List[int]:
      """Performs insertion sort on a given list of integers and returns the sorted list.
      >>> insertion_sort([3, 4, 2, 1, 5])
      [1, 2, 3, 4, 5]
      >>> insertion_sort([5, 3, 1, 2, 4])
      [1, 2, 3, 4, 5]
      """
output:     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