CDW Interview Question

Code to calculate next greater element in circular array