Back to problems

Splitwise / Settle Group Balances

Object-Oriented Programming · Pinterest · Medium

Requirements You receive a collection of transactions, where each entry has the shape {from, to, amount}. The to value may name one recipient or contain several recipients; when it is a list, divide the total amount evenly among its members. Return any set of repayments in the form {payer, receiver, amount} that makes every participant's overall balance equal to zero once those repayments are combined with the initial transactions. Minimizing the number of transfers is not…

Checking your access…