← 返回 pinterest 的题目列表Account Balancing
类型:online_judge
Given a list of transactions transactions[k] = {from, to, amount}, output any set of paybacks[m] = {payer, receiver, amount} that reduces everyone's net balance to zero. The solution does not need to minimize the number of transactions, it just needs to be feasible.
Example
Input
[["A", "B", 10], ["B", "C", 5], ["A", "C", 5]]