Clean Python solution with explanation
The following requirements define valid tic-tac-toe board:\n Zero or one players win, it is impossible that both players win\n If player "X" wins "X" must have 
The following requirements define valid tic-tac-toe board:\n* Zero or one players win, it is impossible that both players win\n* If player "X" wins "X" must have made one more move than player "O" (because player "X" makes the first move)\n* If player "O" wins both players must have made the same number of moves\n* If neither of the players win "X" made either the same amount of moves as "O" or "X" made one more move than "O".\n\n```\n    def validTicTacToe(self, board: List[str]) -> bool:\n        cnt = Counter("".join(board))\n        wins_search_space = board + \\\n            list("".join(x) for x in zip(*board)) + \\\n            [\n                "".join(board[i][i] for i in range(3)),\n                "".join(board[i][2-i] for i in range(3)),\n            ]\n        X_wins = "XXX" in wins_search_space\n        O_wins = "OOO" in wins_search_space\n\n        if X_wins and O_wins:\n            return False\n        elif X_wins:\n            return cnt["X"] - cnt["O"] == 1\n        elif O_wins:\n            return cnt["X"] - cnt["O"] == 0\n        else:\n            return 0 <= cnt["X"] - cnt["O"] <= 1\n```
['Python', 'Python3']