Code RoomAlternate lane merge
EasyPrep Room Coding #367

Alternate lane merge

CodingDatabases & SQLAlgorithms & data structuresEntry–Mid~11 min

Two checkout lanes feed a single packing desk, which alternates between them: one order from lane A, one from lane B, and so on, starting with lane A. When one lane runs out, the desk takes the rest from the other lane in order. Given the two lanes' order numbers, return the sequence the desk processes. Example: A = [1, 3, 5] and B = [2, 4] give [1, 2, 3, 4, 5].

Implement
interleave_lanes(a: list[int], b: list[int]) → list[int]
Examples
in[[1,3,5],[2,4]]out[1,2,3,4,5]
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
InputExpectedGot
[[1,3,5],[2,4]][1,2,3,4,5]not run yetsample