Find the greater element - WA

Not passing 1 test case

ashutosh read the question again it said it is a circular array so for the last element its not necessay -1
for input
6
3 4 6 10 1 8
output
4 6 10 -1 8 10
ur output
4
6
10
-1
8
-1

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.