Given a data set with details pertaining to amount that one person owes to the other in for the form of csv
Sample Input
Friend 1
Friend 2
Amount
M
N
20
L
M
70
N
L
40
N
K
100
Row 1 implies that M owes 20 Rs to N
Row 2 implies that L owes 70 Rs to M
Similar to other rows
Simplification Definition => A owes 2 rs to B. And B owes 2 rs to C. ⇒ A owns 2 rs to C
Given the above info, design a solution to derive the below-mentioned insights :
1) Without simplification,
print for each person, how much he owes total amount
for each person, print to whom this person owes and how much
2) With simplification,
print for each person, how much he owes total amount
for each person, print to whom this person owes and how much