input: Write a python function to find the maximum sum of a contiguous subarray.
  assert max_sum_subarray([1, -3, 2, 1, -1]) == 3
  assert max_sum_subarray([-2, -3, 4, -1, -2, 1, 5, -3]) == 7
  assert max_sum_subarray([5, 4, -1, 7, 8]) == 23
output: def max_sum_subarray(arr):
      max_current = max_global = arr[0]
      for num in arr[1:]:
          max_current = max(num, max_current + num)
          if max_current > max_global:
              max_global = max_current
      return max_global