Settle group trip expenses with the fewest transfers

0
Remix

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.

GoogleTechnical phone screenLast asked Nov 2025
No answer yet. Write the first one; the best answer gets endorsed.