input: Write a function to improve the following Python program to reduce its time complexity.
  
  def find_max_sum(arr):
      max_sum = 0
      for i in range(len(arr)):
          for j in range(i+1, len(arr)): 
              max_sum = max(max_sum, arr[i] + arr[j])
      return max_sum
  
  def find_max_sum(arr):
      max_sum = 0
      left = 0
      right = len(arr) - 1
      while left < right:
          if arr[left] + arr[right] > max_sum:
              max_sum = arr[left] + arr[right]
          if arr[left] > arr[right]:
              right -= 1
          else:
              left += 1
      return max_sum
  assert find_max_sum([3, 1, 5, 7, 2])==12
  assert find_max_sum([4, 2, 9, 3])==13
  assert find_max_sum([1, 2, 3, 4, 5])==9
  assert find_max_sum([5, 4, 3, 2, 1])==9
  assert find_max_sum([])==0
output: def find_max_sum(arr):
      if not arr:
          return 0
      max1 = max(arr)
      arr.remove(max1)
      max2 = max(arr)
      return max1 + max2