DrawCode

Next Greater Element

For each element, find the next greater value to the right using a monotonic decreasing stack.

Browse free without an account. Sign in to save progress, sync likes, and open your canvas workspace.