Transaction Balance & Minimum Settlement

Asked at Affirm · Coding Questions · Difficulty: Hard · Last asked Jul 15, 2026

A payments ledger records every money movement of one day. At the end of the day you need each user's net balance, and then a plan that brings every balance back to zero with as few person-to-person transfers as possible. Build both steps.

Loading the problem…