input: def findMaxSum(limit: int, array: List[int]) -> int:
      """ Find the maximum sum of a subarray within an array of non-negative integers, given an upper limit value.
      >>> findMaxSum(10, [1, 3, 5, 4, 2, 6])
      10
      >>> findMaxSum(7, [1, 3, 5, 4, 2, 6])
      7
      """
output:     max_sum = 0
      current_sum = 0
      start = 0
      
      for end in range(len(array)):
          current_sum += array[end]
          
          while current_sum > limit:
              current_sum -= array[start]
              start += 1
          
          if current_sum > max_sum:
              max_sum = current_sum
      
      return max_sum