Design: Simplify Debts Algorithm System
Design focuses on the algorithm and system to simplify debts. UI, authentication, and persistent storage are out of scope.
Functional Requirements
Non-Functional Requirements
Jump into concepts and practice - no test required
+----------------+ +-------------------+ +-------------------+ +----------------+ | Input Parser | ---> | Debt Graph Builder | ---> | Simplify Algorithm | ---> | Output Generator | +----------------+ +-------------------+ +-------------------+ +----------------+
Simplify debts algorithm in group expense management?net_balances = {"A": 40, "B": -40}
for person, balance in net_balances.items():
if balance > 0:
print(f"{person} owes money")
else:
print(f"{person} is owed money")