2
def minInterval(self, intervals: List[List[int]], queries: List[int]) -> List[int]:4
# sort queries from small to large5
q = deque(sorted([(x, i) for i, x in enumerate(queries)]))7
# answer to queries, initial state set to -18
ans = [-1] * len(queries)10
# sort intervals by low, high and size11
ivals = deque(sorted([(a, b, b - a + 1) for a, b in intervals]))19
# if lower bound of intervals on the top of stack <= current query20
while ivals and x >= ivals[0][0]:21
a, b, c = ivals.popleft()22
# if higher bound of intervals also meets the requirements23
# if not then discard the interval25
heappush(cands, (c, b, a))27
# udpate available intervals by removing old ones which no longer has a eligible higher bound29
c, b, a = heappop(cands)32
heappush(cands, (c, b, a))