input: Write a python function to find the maximum sum of a contiguous subarray.
  assert max_sum([3, 8, -2, 10, -6]) == 19
  assert max_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6
  assert max_sum([1, 2, 3, 4, 5]) == 15
output: def max_sum(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