Test case 2 failing for my code

So I have written the algorithm of picking bith the shoes once (left and right) and move forward and in the end check if the picked sum is odd or not.If the sum ends to be odd I return 1 and 0 otherwise.
There goes the code for the same.

Hey @prabh1601

I believe we discussed this question on chat. So if your doubt is resolved kindly mark it as closed.

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.