Find The Greater Element

I am not able to pass all the test cases kindly correct it and tell me where i am wrong

Please share your code

Failing for simple test case like this :
3
3 1 2
Also its mentioned that array is circular
Follow this for correct approach: Not able to understand the tutorial also?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.