If grid contains atleast one 1 or 0
k = i ; o = j ; break ; } } if ( k != -1 ) { break ; } } if ( k != -1 ) { flag = PosCheck ( a , n , m , '1' ) ; if ( flag ) { fill ( a , n , m , '1' , '0' ) ; } else { flag = PosCheck ( a , n , m , '0' ) ; if ( flag ) { fill ( a , n , m , '0' , '1' ) ; } } } else {