Question simplify debt:
In a group of people:
Mary owes Adam 100
Chan Owes Mary 100$
So we should do no transaction at all because all persons owe each other which nullifies any transaction.
Figure out the minimum transactions required for each of the person.
The total number of transactions for each person should be minimized .
Note-> If 3 users have one transaction each among themselves vs 1 user can do all three . Prefer the later one.
It was exactly Splitwise simplify debt feature.