input: Write a function to find the maximum subarray sum.
  assert max_subarray_sum([-2, -3, 4, -1, -2, 1, 5, -3]) == 9
  assert max_subarray_sum([1, 2, 3, -2, 5]) == 9
  assert max_subarray_sum([-1, -2, -3, -4]) == 0
  assert max_subarray_sum([4, -1, 2, 1]) == 6
output: def max_subarray_sum(arr):
      max_sum = 0
      current_sum = 0
      
      for num in arr:
          current_sum = max(num, current_sum + num)
          max_sum = max(max_sum, current_sum)
      
      return max_sum