2 TEST CASES R FAILING

Hello @asinghal1_be19 please wait i am checking your code:

Hello @asinghal1_be19 you should do this question with the help of indexing i.e you should push index in the stack because with that you access elements as well as location of that element.
and also there is one more thing in this i.e you should handle circular part in this as well like if the last element is smaller then the first element then you for last element you have to print the first element.
Here for your reference i am attaching the code:


if you have any doubt you can ask here:
Happy Learning!!

plz tell the test case for which my code is failing with the bexpected output and my wrong output

Hello @asinghal1_be19 try for this :
4
8 2 3 6
correct output: -1 3 6 8.
Happy Learning!!

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.