https://codeforces.com/problemset/problem/812/B
its passing the example cases but giving WA when submitting
my code is:-
https://ide.codingblocks.com/#/s/24458
Backtracking https://codeforces.com/problemset/problem/812/B
3 2
0000
0100
0100
Your code gives 6 but the answer should be 4. You need to print the optimal answer.