Portfolio NAV Growth Analysis Engine
Portfolio NAV Growth Analysis Engine
Arjun invested in multiple mutual funds through an Indian brokerage with historical NAV tracking. He has initial NAV, current NAV, and amounts invested in each fund. Calculate portfolio value, overall return percentage, and identify the best performing fund.
Approach
Given funds [[initial_nav, current_nav, invested]]: portfolio_value = sum of round(current/initial*invested); overall_return = (value-total_invested)/total_invested*100; best_fund_return = max (current-initial)/initial*100. Print 'portfolio_value=V,overall_return=R%,best_fund_return=B%' (percent: up to 2 decimals, trailing zeros dropped).
Input
Output
More Arrays problems
Browse all coding problems →Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards