Problem 496 · Easy

Next Greater Element I

Find next greater element for each using monotonic stack.

Open the interactive visualisation