NEED HELP IN YESTERDAY'S SECOND QUESTION , FLIP

My submission - CodeChef: Practical coding for everyone
Can you plz review the code and help in providing the failing test cases as all my custom inputs are passing the code

Your code fails for the following test case:
1
1010001
0000000
The answer should be 2 but your code outputs 1.
Try and understand and why your code fails for this test case and it will help you to solve your error :grinning: