input: Write a function to find the maximum sum of an array of non-negative integers such that the sum does not exceed a given upper limit value.
  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])==9
  assert findMaxSum(10, [1, 2, 3, 4, 5])==10
  assert findMaxSum(10, [5, 5, 5, 5])==10
  assert findMaxSum(10, [2, 3, 7, 1, 6])==9
  assert findMaxSum(10, [])==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