Can someone tell me why my python code is wrong?

question:https://www.codechef.com/problems/LCOLLIS
my code:https://www.codechef.com/viewsolution/25143884

Hey, so you’ve counted no. of 1s in a row. While you should do this for column as a boy’s choice (0 or 1) for each girl is described in a row. See my solution.

thanks for replying but can you tell me some example for which my code gives the wrong output

Try this:
1000
0100
0010
0010

The correct output should be 1 but your code gives 0.

1 Like