Help needed with needed with DEFECTS problem

My code is working sample test cases, Can anyone explain what is required do we need to count how many steps needed to convert the whole matrix into 1?

link: DEFECTS Problem - CodeChef

All 1s or all 0s is OK

I have received wrong answer any idea what could be the test case?