Question
An API gateway writes "REQ <id>" when a request enters and "RESP <id>" when its response leaves. Each id has at most one REQ line and at most one RESP line, and a RESP for an id always appears after its REQ. During an incident you need the requests that never completed. Given the log lines in order, return the ids that have a REQ line but no RESP line, in the order their REQ lines appear.
unanswered_requests(lines: list[str]) → list[str][["REQ a1","REQ b2","RESP a1","REQ c3"]]out["b2","c3"]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.