Find greater Element (stacks)

Where is the problem in my code
Here I am sharing the url of my code.

Check for this input:
5
6 8 0 1 3
Expected output for this is:
8 -1 1 3 6
It’s a circular array, you are close to do it. Try again.

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.