Cannot find mistake, please help

Can you please tell me where I made mistake?

code

I submitted it five times with minor modifications but got WA in all. I was able to solve rest of the problems without any problem. Please help with this one

Problem

Brother when you are setting flag=1, then afterwards if any row with more no of 1s is present, the flag is not set to 0.

So inside if block add flag=0

It will work.

1 Like

https://www.codechef.com/viewsolution/7718345

See this solution, it is yours. I just added “flag=0;” and it got AC :slight_smile:

Hope you can understand.

1 Like