input: Write a function to sort an array in descending order using insertion sort.
  assert rearrange([1, 2, 3]) == [3, 2, 1]
  assert rearrange([10, 20, 5, 3, 7]) == [20, 10, 7, 5, 3]
  assert rearrange([5, 7, 1, 4, 2]) == [7, 5, 4, 2, 1]
output: def rearrange(arr):
      for i in range(1, arr.length):
          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