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