input: Write a function to improve the time complexity of the given function that finds the maximum sum of any two distinct elements in an array. The improved function should return the maximum sum of two distinct elements in the array.
  assert find_max_sum([1, 2, 3, 4, 5]) == 9
  assert find_max_sum([10, 1, 5, 3, 8]) == 18
  assert find_max_sum([1, 1, 1, 1, 1]) == 2
  assert find_max_sum([9, 7, 5, 4, 2]) == 16
  assert find_max_sum([5, 4, 3, 2, 1]) == 9
output: def find_max_sum(arr):
      if len(arr) < 2:
          return None
      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 and num != first_max:
              second_max = num
      return first_max + second_max