saumyasinghz / Misc-codes-

Data Structure and algorithm codes in c++
0 stars 1 forks source link

Transform to Chessboard #3

Open saumyasinghz opened 2 years ago

saumyasinghz commented 2 years ago

You are given an n x n binary grid board. In each move, you can swap any two rows with each other, or any two columns with each other.

Return the minimum number of moves to transform the board into a chessboard board. If the task is impossible, return -1.

A chessboard board is a board where no 0's and no 1's are 4-directionally adjacent.

tannydas2000 commented 2 years ago

Assign please