input: Write a function to find the maximum subarray sum.
  assert max_sub_array_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6
  assert max_sub_array_sum([1,2,3,4,5]) == 15
  assert max_sub_array_sum([-1,-2,-3,-4]) == 0
output: def max_sub_array_sum(nums):
      max_sum = 0
      current_sum = 0
      for num in nums:
          current_sum += num
          if current_sum > max_sum:
              max_sum = current_sum
          if current_sum < 0:
              current_sum = 0
      return max_sum