input: Write a function to find the maximum sum of an array of non-negative integers, given an upper limit value. If the given array is empty or all elements exceed the limit, return 0.
  assert findMaxSum(10, [1, 3, 5, 4, 2, 6])==10
  assert findMaxSum(7, [1, 3, 5, 4, 2, 6])==6
  assert findMaxSum(20, [1, 3, 5, 4, 2, 6])==21
  assert findMaxSum(2, [5, 1, 3, 2, 6])==2
  assert findMaxSum(5, [])==0
output: def findMaxSum(limit, arr):
      if not arr:
          return 0
      arr.sort()
      current_sum = 0
      for num in arr:
          if current_sum + num > limit:
              break
          current_sum += num
      return current_sum