Search
⌘K

Leetcode 503. Next Greater Element II

Given a circular array, for each element find the first greater value encountered when traversing right (wrapping around), or return -1 if none exists. This is a next-greater-element problem typically solved with a monotonic decreasing stack to handle wrap-around efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.