Question
A dispatcher must keep at least one courier on duty for the entire window from time 0 to time t (t >= 1). shifts[i] = [start, end] means courier i is willing to work that whole span. Return the minimum number of shifts to select so that every moment in [0, t] is covered, or -1 if it cannot be done. Example: shifts [[0,2],[1,5],[4,7]] with t = 6 needs 3 shifts.
min_shifts(shifts: list[list[int]], t: int) → int[[[0,2],[1,5],[4,7]],6]out3State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.