Problem 1019 · Medium

Next Greater Node In Linked List

Scan the list once with a monotonic stack of positions still waiting for a larger value.

Open the interactive visualisation