Simple Python solution
take turn and the first player always plays \'X\', so xc must >=oc and xc<=oc+1.\n\t\t# if the first player wins, the \'X\' count number(c1) should be one more 
# take turn and the first player always plays \'X\', so xc must >=oc and xc<=oc+1.\n\t\t# if the first player wins, the \'X\' count number(c1) should be one more than \'O\'(c2).\n\t\t# if the second player wins, the \'X\' count number should be equal to \'O\'.\n\t\t# they cannot both win, no need to check. bcoz otherwise c1==c2-1==c2, which is never true.\n\n```\nclass Solution:\n    def validTicTacToe(self, board: List[str]) -> bool:\n        def win(board,c):\n            for line in board:\n                if line[0]==line[1]==line[2]==c:return True\n            for col in range(3):\n                if board[0][col]==board[1][col]==board[2][col]==c:return True\n            if board[0][0]==board[1][1]==board[2][2]==c:return True\n            if board[0][2]==board[1][1]==board[2][0]==c:return True\n            return False\n        c=collections.Counter(\'\'.join(board))\n        xc,oc=c[\'X\'],c[\'O\']\n        if xc<oc or xc>oc+1:return False\n        if win(board,\'X\') and oc!=xc-1:return False\n        if win(board,\'O\') and oc!=xc:return False\n        return True\n```\n
[]