Python O(1) concise code
\nclass Solution:\n    def validTicTacToe(self, board):\n        """\n        :type board: List[str]\n        :rtype: bool\n        """\n        X, O = self.cou
```\nclass Solution:\n    def validTicTacToe(self, board):\n        """\n        :type board: List[str]\n        :rtype: bool\n        """\n        X, O = self.countBoard(board)\n        if X - O not in {0, 1}:\n            return False\n        \n        if self.checkBoard(board, \'X\') and X == O:\n            return False\n        if self.checkBoard(board, \'O\') and X - 1 == O:\n            return False\n        \n        return True\n        \n    def checkBoard(self, board, player):\n        for i in range(3):\n            if board[i] == player * 3:\n                return True\n            if all(board[j][i] == player for j in range(3)):\n                return True\n        \n        if player == board[1][1] == board[0][0] == board[2][2]:\n            return True\n        if player == board[1][1] == board[0][2] == board[2][0]:\n            return True\n            \n    \n    def countBoard(self, board):\n        X, O = 0, 0\n        for row in board:\n            X += row.count(\'X\')\n            O += row.count(\'O\')\n        return X, O\n        \n        \n        \n    \n```
[]