Question
A bitmap index represents each predicate as a list of row positions (0-based) where the predicate is true, given as a SORTED list of ints. Evaluate a boolean query: given bitmaps `a`, `b`, `c` and an operator string, return the sorted list of matching row ids. Supported operators: 'and' = a AND b, 'or' = a OR b, 'and_not' = a AND NOT b, 'and_or' = a AND (b OR c). Each input bitmap is sorted with no duplicates. The result must be sorted ascending with no duplicates.
bitmap_query(a: list[int], b: list[int], c: list[int], op: str) → list[int][[0,1,2,3],[2,3,4],[],"and"]out[2,3]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.