input: Write a function to improve the time complexity of the given Python program that finds the maximum sum of any two distinct elements in an array. 
  
  ### Input:
  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
  
  ### Output:
  def find_max_sum(arr):
      if len(arr) < 2:
          return 0
      max1 = max(arr)
      arr.remove(max1)
      max2 = max(arr)
      return max1 + max2
  
  assert find_max_sum([3, 4, 5, 1, 2])==9
  assert find_max_sum([3, 5, 10, 1, 2])==15
  assert find_max_sum([4, 3, 1, 2])==7
  assert find_max_sum([3, 5, 4, 1, 2])==9
  assert find_max_sum([])==0
  assert find_max_sum([1])==0
output: def find_max_sum(arr):
      if len(arr) < 2:
          return 0
      max1 = max(arr)
      arr.remove(max1)
      max2 = max(arr)
      return max1 + max2