Back to problems

Transaction Settlement

Algorithm · Pinduoduo · Hard

Minimum-Transaction Settlement Problem You are given transaction records describing transfers between people, such as one person giving another a specified amount. Design an algorithm that produces transactions settling everyone’s balances while using as few transactions as possible. Assume the records are: One possible result is: Among the valid ways to settle the balances, select one with the minimum number of transactions. Input Constraints Every record follows the…

Loading the rest of the question…