Suggest any optimizations in my approach for Problem C in Ed Round 191 Div 2
Here's my solution for C, it's O(n^2) solution, do you guys see any optimizations in my approach? It's basically kind of pre-computing prefix and suffix counts. And then starting from largest values, removing it, and update corresponding values in open or close vectors. Ik this is looking too much of unnecessary work, and i think it can be solved without maintaining open and close vectors, even tho going by my approach.
Posted Jun 10, 2026, 4:36 PM UTC
10