input: Write a python function to find the maximum subarray sum.
  assert max_subarray_sum([1, 8, -1, 3, 4, -2]) == 15
  assert max_subarray_sum([-2, -3, 4, -1, -2, 1, 5, -3]) == 7
  assert max_subarray_sum([1, -2, 3, 10, -4, 7, 2, -5]) == 18
  assert max_subarray_sum([-1, -2, -3, -4]) == -1
output: def max_subarray_sum(nums):
      max_sum = current_sum = nums[0]
      for num in nums[1:]:
          current_sum = max(num, current_sum + num)
          max_sum = max(max_sum, current_sum)
      return max_sum