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