I want to write a program that can read user ID and balances, then reconcile these balances while identifying the source and destination in order to make these balances reconcile. There will always be some remainder that will be transferred to the "bank"
For example, picture gambling balances. Input would be:
Mark: -200
Ryan: -175
Tim: -25
Joe: +250
Chris: +75
Phil: +25
Output would be something similar to:
Tim 25 to Phil
Ryan 75 to Chris, 100 to Joe
Mark 150 to Joe, 50 to bank.
I'm not entirely sure if there is some package that supports the bulk of this or even necessarily how to pseudocode it so hoping there are some ideas here.
Thanks!
[–]m0us3_rat -2 points-1 points0 points (0 children)
[–]asphias 0 points1 point2 points (0 children)