Next greater element in a circular array
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.
No answer yet. Write the first one; the best answer gets endorsed.
