Gusto Interview Question

Implement a simple Splitwise-like function that settles a system of loans.