Valid Tic-Tac-Toe State
Examples
Example 1:
Input: board = ["O "," "," "]
Output: false
Example 2:
Input: board = ["XOX","O O","XOX"]
Output: true
Example 1:
Input: board = ["O "," "," "]
Output: false
Example 2:
Input: board = ["XOX","O O","XOX"]
Output: true
Given a Tic-Tac-Toe board represented by board, return true if and only if it is possible to reach this board position during a valid game.
The board is a 3x3 array where each entry is either "X", "O", or a space " ".
The game rules are:
X always plays first.board.length == 3board[i].length == 3board[i][j] is either 'X', 'O', or ' '