input: 
  def findMaxSum(limit: int, array: List[int]) -> int:
      """ Find the maximum sum of a subarray in the given array of non-negative integers
      that is less than or equal to the given limit.
      >>> findMaxSum(10, [1, 3, 5, 4, 2, 6])
      10
      >>> findMaxSum(12, [1, 3, 5, 4, 2, 6])
      12
      >>> findMaxSum(5, [1, 3, 5, 4, 2, 6])
      5
      """
      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
  
output:     maxSum = 0
      currentSum = 0
      start = 0
      for end in range(len(array)):
          currentSum += array[end]
          while currentSum > limit:
              currentSum -= array[start]
              start += 1
          if currentSum > maxSum:
              maxSum = currentSum
      return maxSum