input: Write a function to calculate the sum of the minimum element and all previous elements in an array.
  assert min_sum_array([13, -2, 7, -6, 5]) == -11
  assert min_sum_array([1, 2, 3, 4, 5]) == 1
  assert min_sum_array([10, -1, -2, -3, -4, -5]) == -5
output: def min_sum_array(arr):
      min_elem = min(arr)
      min_index = arr.index(min_elem)
      return sum(arr[:min_index + 1])