Reconcile ledger transactions

Write codeMedium15 minStripe and Palantir style

Your task

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"].

Examples

reconcile_ledgers(ledger_a: list[str], ledger_b: list[str]) -> list[str]
Example 1
Inputreconcile_ledgers(["t1,100", "t2,50", "t3,75"], ["t1,100", "t2,60", "t4,20"])
Output["t2", "t3", "t4"]