[ INFO ]category: Coding difficulty: medium freq: high first seen: 2026-01-14
[MEDIUM][CODING][HIGH]GraphDFSBacktrackingGreedy
$catproblem.md
You are given an array of 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.
Notes:
You may assume there is at least one way to settle all debts.
Each transaction must involve two different people.
Do not reuse or split the original transactions; you can only create new ones between people with outstanding balances.
The input is a list transactions, where each element is a list [from, to, amount].