0465. Optimal Account Balancing
https://leetcode.com/problems/optimal-account-balancing
Description
You are given an array of transactions transactions
where transactions[i] = [fromi, toi, amounti]
indicates that the person with ID = fromi
gave amounti $
to the person with ID = toi
.
Return the minimum number of transactions required to settle the debt.
Example 1:
Example 2:
Constraints:
1 <= transactions.length <= 8
transactions[i].length == 3
0 <= fromi, toi <= 20
fromi != toi
1 <= amounti <= 100
ac
Last updated