input: Write a function to find the maximum sum of an array of non-negative integers, given an upper limit value. If there is no valid sum that is less than or equal to the limit, return 0.
  assert findMaxSum(10, [1, 3, 5, 4, 2, 6]) == 10
  assert findMaxSum(8, [1, 3, 5, 4, 2, 6]) == 8
  assert findMaxSum(15, [1, 3, 5, 4, 2, 6]) == 15
  assert findMaxSum(0, [1, 3, 5, 4, 2, 6]) == 0
  assert findMaxSum(5, [1, 3, 5, 4, 2, 6]) == 5
output: def findMaxSum(limit, arr):
      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]