Question d’entretien chez Morgan Stanley

Portfolio balances problem from Hackerrank - 1st round - medium