Penalty Shootout 2. Can anyone tell me where am I going wrong and how to correct it?

Here is the link to my solution CodeChef: Practical coding for everyone

in the below test case
10101000
you code is giving ans as 6 but the ans is 5
you are only checking the condition at i==2*n-3 which i guess is creating problem

1 Like