Sample testcase are passed still showing wrong answer

code is running fine for sample test case given in question but showing wrong answer on submit…please tell me the mistake

Hello @Riyachaudhary07,

Please, share your code using Online Coding Blocks IDE: https://ide.codingblocks.com/
STEPS:

  1. Paste your code there.
  2. Save it.
  3. Share the URL generated.

Hello @Riyachaudhary07,

Your code is failing for the test cases with a single element.
Example:
1
1
3
Your ouput:
0
Expected Output:
1

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

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.