Probe with most solo coverage
A network operations centre stitches link coverage together from several monitoring probes. Two parallel lists describe them: probe i watches the link from starts[i] up to but not including ends[i]. The probes arrive in no particular order, their windows overlap freely, no probe ends before it starts, and a probe with ends[i] equal to starts[i] watches nothing. A minute is solo for probe i when probe i is the only probe watching it. The centre wants to know which probe would be missed most if it were retired, so return the index of the probe holding the largest number of solo minutes, breaking ties by the smallest index. Every probe is a candidate, including one with no solo minutes at all. Return -1 when there are no probes. The list can run to 100000 probes.
solo_cover_leader(starts: list[int], ends: list[int]) → int[[0,3],[10,5]]out0[[0,5],[6,12]]out1[[0,0],[10,10]]out0State 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.
[[0,3],[10,5]]0not run yetsample[[0,5],[6,12]]1not run yetsample[[0,0],[10,10]]0not run yetsample