Next greater element in a circular array

0
Remix

You get an integer array that wraps around: after the last element, scanning continues from the first. For every index, return the first value strictly greater than its own that you meet while scanning forward (wrapping as needed), or a marker such as -1 when no such value exists.

GoogleCodingLast asked Sep 2026
No answer yet. Write the first one; the best answer gets endorsed.