Question
Implement run-length encoding for a columnar store. Given a list of integer values (a column), produce a compact encoding as a list of [value, count] pairs where consecutive equal values are collapsed into one run. Then, to prove the codec round-trips, DECODE that encoding back into the original list and return the decoded list. The function must return the decoded list (which should equal the input). Input length <= 10^5.
rle_roundtrip(values: list[int]) → list[int][[1,1,1,2,2,3]]out[1,1,1,2,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.