Question
A composite B-tree index is keyed on (region, score) and stores entries sorted by region ascending, then score ascending. Entries are given as [region, score, row_id], already in that sorted order. Implement an index seek for the query WHERE region = R AND score >= min_score, returning the row_ids of matching entries in index order. You must use the index ordering to seek — binary-search to the first matching entry rather than scanning all entries (assume the matching slice is small relative to the index). region is a string, score an int. Up to 200000 entries.
composite_index_seek(entries: list[list], region: str, min_score: int) → list[int][[["east",10,1],["east",20,2],["west",5,3]],"east",15]out[2]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.