Python3 super readable solution - Valid Tic-Tac-Toe State
\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        def wins(c: str) -> bool:\n            cols = map(lambda x:\'\'.join(x), zip
```\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        def wins(c: str) -> bool:\n            cols = map(lambda x:\'\'.join(x), zip(*board))\n            diags = map(lambda x:\'\'.join(x),\n                        ((board[i][i] for i in range(3)),\n                         (board[i][-i-1] for i in range(3))))\n            return any(row == c * 3 for row in itertools.chain.from_iterable((board, cols, diags)))\n        \n        Xwins = wins(\'X\')\n        Owins = wins(\'O\')\n        \n        if Xwins and Owins:\n            return False\n        \n        countX = sum(row.count(\'X\') for row in board)\n        countO = sum(row.count(\'O\') for row in board)\n        \n        if not Xwins and not Owins:\n            return countX == countO or countX == countO + 1\n        if Xwins:\n            return countX == countO + 1\n        return countX == countO\n```
['Python', 'Python3']