Settle group trip expenses with the fewest transfers
Friends on a trip record payments: each record names the payer, the amount and the people it covered (the payer may be among them), split evenly. Compute each person's net balance, then return the fewest transfers that settle all debts, and the transfers themselves. Discuss greedy matching versus an exact search.
No answer yet. Write the first one; the best answer gets endorsed.
