Search⌘ K
AI Features

Solution: Optimal Account Balancing

Optimal Account Balancing gives transactions showing who paid whom and how much, then asks for the fewest additional transactions needed to settle every person's debt.

Statement

Given a list of transactions, where each transaction is represented as transactions[i]=[fromi, toi, amounti]transactions[i] = [from_i,~ to_i,~amount_i] ...