input: Write a function to find the maximum sum of any pair of elements in an array.
  assert max_pair_sum([1, 2, 3, 4, 5]) == 9
  assert max_pair_sum([10, 20, 30, 40, 50]) == 90
  assert max_pair_sum([5, 5, 5, 5, 5]) == 10
  assert max_pair_sum([-10, -20, 10, 20]) == 30
  assert max_pair_sum([]) == 0
output: def max_pair_sum(arr):
      if len(arr) < 2:
          return 0
      arr.sort()
      return arr[-1] + arr[-2]