Code Room
CodingMediumcod-g1218
Subject Data wranglingLevel Entry–Mid~15 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Two systems each export a ledger of the day's transactions as rows "id,amount" (amount an integer; each id appears at most once per ledger). A transaction needs review when the two ledgers disagree: the amounts differ, or the id appears in only one ledger. Return the ids needing review, sorted ascending. Example: ledger_a ["t1,100", "t2,50", "t3,75"] and ledger_b ["t1,100", "t2,60", "t4,20"] give ["t2", "t3", "t4"].

Implement
reconcile_ledgers(ledger_a: list[str], ledger_b: list[str]) → list[str]
Examples
in[["t1,100","t2,50","t3,75"],["t1,100","t2,60","t4,20"]]out["t2","t3","t4"]
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.

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.

Run or narrate your approach, then ask the coach.