Modular and Extensible Python Solution - Beats 90%
O(1) time complexity, O(1) space complesity\n\n```\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        n = 3\n        rows = [0] 
O(1) time complexity, O(1) space complesity\n\n```\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        n = 3\n        rows = [0] * n\n        cols = [0] * n\n        diag = antidiag = balance = 0\n        \n        def win(v):\n            if v in rows or v in cols or v in [diag, antidiag]: return True\n            return False\n        \n        for i in range(n):\n            for j in range(n):\n                if board[i][j] != " ":\n                    balance += 1 if board[i][j] == "X" else -1\n                    rows[i] += 1 if board[i][j] == "X" else -1\n                    cols[j] += 1 if board[i][j] == "X" else -1\n                    if i == j: diag += 1 if board[i][j] == "X" else -1\n                    if i + j == n - 1: antidiag += 1 if board[i][j] == "X" else -1\n        \n        if not 0 <= balance <= 1: return False\n            \n        if balance == 0 and win(n): return False\n        if balance == 1 and win(-n): return False\n        \n        return True
['Python3']