Question
Parse an HTTP Range header against a known resource size. The header looks like 'bytes=START-END'. Support three forms: 'bytes=N-M' (explicit range), 'bytes=N-' (from N to end), and 'bytes=-N' (the last N bytes, a suffix range). Return [start, end] as inclusive 0-based byte offsets, clamping END to size-1. If the header is unsatisfiable (start beyond the resource, malformed, wrong unit, or a zero-length suffix), return [-1, -1].
parse_range(header: str, size: int) → list[int]["bytes=0-499",1000]out[0,499]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.
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.