input: def findMaxSum(limit: int, array: List[int]) -> int:
      """Find the maximum sum of a subarray of non-negative integers that is less than or equal to the given upper limit.
      >>> findMaxSum(10, [1, 3, 5, 4, 2, 6])
      10
      """
output:     
      max_sum = 0
      current_sum = 0
      for num in array:
          if current_sum + num <= limit:
              current_sum += num
              if current_sum > max_sum:
                  max_sum = current_sum
          else:
              current_sum = 0
      return max_sum
  