An investor opens a new account and wants to invert in a number of assets. Each asset begins with a balance of 0, and its value is stored in an array using 1-based indexing. Periodically, a contribution is received and equal investments are made in a subset of the portfolio. Each contribution will be given by investment amount, start index, end index. Each investment in that range will receive the contribution amount. Determine the maximum amount invested in any one investment after all contributions.
This is a companion discussion topic for the original entry at https://algo.monster/problems/citadel-oa-portfolio-balances/