Problems > Days Until Warmer > Editorial

Days Until Warmer — Solution & Editorial

Back to the Problem

Same monotonic stack as next-greater-element, but record index differences instead of values.

Complexity: O(N)