Missing sequence numbers
Each event shipped by a log agent carries a sequence number, and the collector wants to know what got dropped in transit. You receive the sequence numbers that actually arrived — distinct positive integers, possibly out of order because of retries. Return every missing sequence number between the smallest and largest received values, in ascending order. If fewer than two numbers arrived, or the range is complete, return an empty list.
Implement
missing_sequences(seqs: list[int]) → list[int]Examples
in
[[7,3,5,8]]out[4,6]What a strong answer looks like
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.
0:00 of about 11 min
solution.py
InputExpectedGot
[[7,3,5,8]][4,6]not run yetsample