input: Write a function to find the maximum sum of an array of non-negative integers that is less than or equal to a given upper limit value. Return the maximum sum found. If no sum is less than or equal to the limit, return 0. If the array is empty, return 0.
  
  assert findMaxSum(10, [1, 3, 5, 4, 2, 6])==10
  assert findMaxSum(15, [1, 3, 5, 4, 2, 6])==15
  assert findMaxSum(5, [1, 3, 5, 4, 2, 6])==5
  assert findMaxSum(7, [1, 3, 5, 4, 2, 6])==7
  assert findMaxSum(30, [])==0
  assert findMaxSum(30, [1, 1, 2, 2, 3, 3])==12
output: def findMaxSum(limit, arr):
      if not arr:
          return 0
      dp = [0] * (limit + 1)
      for num in arr:
          for i in range(limit, num - 1, -1):
              dp[i] = max(dp[i], dp[i - num] + num)
      return dp[limit]