Two-track slot fill
A radio show has a slot of exactly slot seconds left and wants to fill it with two tracks whose durations (in seconds) add up to slot exactly. The two tracks must come from different positions in the durations list, though their durations may be equal. Return the chosen pair as [shorter, longer] in ascending order. If several pairs fit, return the one whose shorter duration is smallest; if no pair fits, return an empty list. For example, durations [180, 240, 120, 300] with slot 420 gives [120, 300] rather than [180, 240].
duet_fill(durations: list[int], slot: int) → list[int][[180,240,120,300],420]out[120,300]State 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.
[[180,240,120,300],420][120,300]not run yetsample