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. The function should return the maximum sum. If the array is empty or has only one element, the function should return 0.
  def find_max_sum(arr):
      if len(arr) < 2:
          return 0
      max1, max2 = max(arr[0], arr[1]), min(arr[0], arr[1])
      for num in arr[2:]:
          if num > max1:
              max2 = max1
              max1 = num
          elif num > max2:
              max2 = num
      return max1 + max2
  
  assert find_max_sum([1, 2, 3, 4]) == 7
  assert find_max_sum([4, 2, 1, 3]) == 7
  assert find_max_sum([1, 1, 1, 1]) == 2
  assert find_max_sum([-1, -2, -3, -4]) == -3
  assert find_max_sum([]) == 0
  assert find_max_sum([5]) == 0
output: def find_max_sum(arr):
      if len(arr) < 2:
          return 0
      max1, max2 = max(arr[0], arr[1]), min(arr[0], arr[1])
      for num in arr[2:]:
          if num > max1:
              max2 = max1
              max1 = num
          elif num > max2:
              max2 = num
      return max1 + max2