Problem 2454 · Hard

Next Greater Element IV

Find for each index the second later value that is strictly greater than its value.

Open the interactive visualisation