Python logical and self-explanatory
\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        Xs = Os = dia1 = dia2 = 0\n        row = [0] * 3\n        col = [0] * 3\n   
```\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        Xs = Os = dia1 = dia2 = 0\n        row = [0] * 3\n        col = [0] * 3\n        for r in range(3):\n            for c in range(3):\n                if board[r][c] == \'X\':\n                    Xs += 1\n                    row[r] += 1\n                    col[c] += 1\n                    if c == r:\n                        dia1 += 1\n                    if c + r == 2:\n                        dia2 += 1\n                elif board[r][c] == \'O\':\n                    Os += 1\n                    row[r] -= 1\n                    col[c] -= 1\n                    if c == r:\n                        dia1 -= 1\n                    if c + r == 2:\n                        dia2 -= 1\n           \n        if max(max(row), dia1, dia2, max(col)) == 3: #X is winning, then O cannot win or cannot move after X wins\n            if Xs == Os + 1 and min(min(row), dia1, dia2, min(col)) > -3:\n                return True\n        elif min(min(row), dia1, dia2, min(col)) == -3: #O is winning, then X cannot win or cannot move after X wins\n            if Xs == Os and max(max(row), dia1, dia2, max(col)) < 3:\n                return True\n        else: #nobody is winning\n            if ((Xs == Os) or (Xs == Os + 1)):\n                return True\n        return False\n```
['Python', 'Python3']