To qualify for liquidity rebate tiers at Optiver and Jump Trading, a market maker must provide continuous quote commitments across an entire market session of length (interval ).
You are provided with a collection of quote commitments quotes where each quote is an interval [s_i, e_i]. You can select any subset of these commitments.
Your Task
Implement min_quotes_to_cover_window(quotes: list[list[int]], target_time: int) -> int that finds the minimum number of quote commitments needed to cover completely without any uncovered gap. If complete coverage is impossible, return .
Constraints
Examples
quotes = [[0, 2], [4, 6], [8, 10], [1, 9], [1, 5], [5, 9]]
target_time = 10
# Quotes [0, 2], [1, 9], [8, 10] covers [0, 10] using 3 quotes.
# Output: 3
quotes = [[0, 1], [6, 8]]
target_time = 5
# Gap between 1 and 6 cannot be bridged.
# Output: -1