Code RoomRegister bank mismatch
MediumPrep Room Coding #413

Register bank mismatch

CodingAlgorithms & data structuresEntry–Mid~16 min

A shop compares its own register log against the bank statement, day by day. Both inputs are rows "date,amount" (date like "2026-03-01"; amount an integer, negative for refunds; a date can have many rows in either input). The two agree on a date when the SUMS of that date's amounts match; a date absent from one side counts as sum 0 there. Return the dates that disagree, sorted ascending. Example: register ["2026-03-01,50", "2026-03-01,25", "2026-03-02,40"] vs bank ["2026-03-01,75", "2026-03-02,35"] gives ["2026-03-02"].

Implement
daily_mismatches(register: list[str], bank: list[str]) → list[str]
Examples
in[["2026-03-01,50","2026-03-01,25","2026-03-02,40"],["2026-03-01,75","2026-03-02,35"]]out["2026-03-02"]
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 16 min
InputExpectedGot
[["2026-03-01,50","2026-03-01,25","2026-03-02,40"],["2026-03-01,75","2026-03-02,35"]]["2026-03-02"]not run yetsample