input: Write a function to determine the maximum sum of an array of non-negative integers, given an upper limit value. The function should iterate through the array and calculate sums of subarrays, updating the maximum sum if the current sum does not exceed the limit and is greater than the previously found maximum sum. If the array is empty or all elements are greater than the limit, the function should return 0.
  
  def findMaxSum(limit, array):
      maxSum = 0
      for i in range(len(array)):
          currentSum = 0
          for j in range(i, len(array)):
              currentSum += array[j]
              if currentSum <= limit and currentSum > maxSum:
                  maxSum = currentSum
      return maxSum
  
  assert findMaxSum(10, [1, 3, 5, 4, 2, 6])==10
  assert findMaxSum(15, [5, 1, 4, 9, 2])==14
  assert findMaxSum(7, [2, 3, 1, 0])==6
  assert findMaxSum(3, [4, 5])==0
  assert findMaxSum(0, [1, 2, 3])==0
output: def findMaxSum(limit, array):
      maxSum = 0
      for i in range(len(array)):
          currentSum = 0
          for j in range(i, len(array)):
              currentSum += array[j]
              if currentSum <= limit and currentSum > maxSum:
                  maxSum = currentSum
      return maxSum