S
svarma
OFFICIAL
08 Aug 2026, 04:06
Why does my solution TLE on the last test case?
A monotonic stack is the trick: pop while the current element breaks the order, and the popped elements have just found their answer.