input: Write a function to find the maximum sum of an array of non-negative integers that does not exceed a given upper limit value. If the input array is empty, the function should return 0. If the upper limit is zero, the function should also return 0.
  
  def findMaxSum(limit, array):
      if not array or limit == 0:
          return 0
      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(5, [1, 3, 5, 4, 2, 6]) == 5
  assert findMaxSum(0, [1, 3, 5, 4, 2, 6]) == 0
  assert findMaxSum(7, [3, 2, 7, 1]) == 6
  assert findMaxSum(15, []) == 0
  assert findMaxSum(20, [10, 5, 3, 7, 2]) == 17
output: 
  def findMaxSum(limit, array):
      if not array or limit == 0:
          return 0
      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
  