input: Write a function to find the maximum subarray sum using the provided function.
  assert maxSubarraySum([-2, -3, 4, -1, -2, 1, 5, -3]) == 7
  assert maxSubarraySum([1, 2, 3, 4, -10]) == 10
  assert maxSubarraySum([-1, -2, -3, -4]) == 0
output: def maxSubarraySum(arr):
      max_so_far = 0
      max_ending_here = 0
      
      for num in arr:
          max_ending_here += num
          if max_ending_here < 0:
              max_ending_here = 0
          if max_so_far < max_ending_here:
              max_so_far = max_ending_here
      
      return max_so_far