Compute minimal transactions to settle debts | Pinterest Interview Question