input: Write a function to reduce the time complexity of the given Python program that finds the maximum sum of any two elements in an array. The improved function should only use a single pass through the array to achieve this. If the given array is empty, return 0.
  
  def find_max_sum(arr):
      if not arr:
          return 0
      first_max = second_max = float('-inf')
      for num in arr:
          if num > first_max:
              second_max = first_max
              first_max = num
          elif num > second_max:
              second_max = num
      return first_max + second_max
  
  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])==6
  assert find_max_sum([3, 5, 4, 1, 2])==8
  assert find_max_sum([])==0
output: def find_max_sum(arr):
      if not arr:
          return 0
      first_max = second_max = float('-inf')
      for num in arr:
          if num > first_max:
              second_max = first_max
              first_max = num
          elif num > second_max:
              second_max = num
      return first_max + second_max