0782. Transform to Chessboard
Last updated
Last updated
**Input:** board = [[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]]
**Output:** 2
**Explanation:** One potential sequence of moves is shown.
The first move swaps the first and second column.
The second move swaps the second and third row.**Input:** board = [[0,1],[1,0]]
**Output:** 0
**Explanation:** Also note that the board with 0 in the top left corner, is also a valid chessboard.**Input:** board = [[1,0],[1,0]]
**Output:** -1
**Explanation:** No matter what sequence of moves you make, you cannot end with a valid chessboard.