A stock portfolio manager performs add/remove operations on a list of stock prices. After all operations, find the total portfolio value. Operations: '1 val' = buy stock at price val, '2 val' = sell stock at price val.
Explanation: Buy 500, buy 750, sell 500, buy 200. Total=750+200=950.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak