Valida el estado del juego de tres en raya
La función recibe un arreglo de tres cadenas que representan un tablero. Los caracteres pueden ser "X", "O", " ". El primer jugador escribe "X" en el primer turno. Si un jugador tiene tres marcas en una fila, columna o diagonal, el juego se detiene. Dado el tablero, evalúa si este estado puede alcanzarse de acuerdo con las reglas y devuelve true o false.
Ejemplos
ValidateTicTacToe(string[] { "X ", " ", " " }) ➞ true
// X goes first.
ValidateTicTacToe(string[] { "O ", " ", " " }) ➞ false
// O cannot go first.
ValidateTicTacToe(string[] { "X X", " O ", " " }) ➞ true
// Two X and one O is a possible state.
ValidateTicTacToe(string[] { "XOX", " X ", " " }) ➞ false
// Three X and one O is not a possible state.
// Players have to go one after another.Notas
N/A