M
mchatterjee
OFFICIAL
10 Aug 2026, 03:53
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.