input: Write a Python function to find the largest sum of any two distinct elements in a given list of integers. The function should return -1 if the list has fewer than two elements.
  
  def maxSumTwoNoOverlap(nums):
      if len(nums) < 2:
          return -1
      nums.sort()
      return nums[-1] + nums[-2]
  
  assert maxSumTwoNoOverlap([1, 2, 3, 4])==7
  assert maxSumTwoNoOverlap([5, 3, 1, 7, 2])==12
  assert maxSumTwoNoOverlap([1, 2])==3
  assert maxSumTwoNoOverlap([])==-1
  assert maxSumTwoNoOverlap([4])==-1
output: def maxSumTwoNoOverlap(nums):
      if len(nums) < 2:
          return -1
      nums.sort()
      return nums[-1] + nums[-2]