Only one case is failing. I did dryrun the code but cannot figure out what is wrong

hello @suhaib0900

the logic that u r applying will work only for linear array.

here in this problem u r given a circular array that why one test case is failing.

for example->
3
3 2 1
output should be
-1 3 3

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.