2/3 test case failing

pls check my code its running perfectly for all custom inputs

Hello @Garvit012,

Your code is failing for the test cases like:
1 2 3 4 5 1 -1

I have corrected your code:

Hope, this would help.
give a like if you are satisfied.

1 Like

thanks a lot sir for your help