[C++] Clean and Easy to understand. With comments. Beats 100% time
\nclass Solution {\npublic:\n    bool iswin(vector<string> &board, char c) {\n        return ((board[0][0] == c && board[0][1] == c && board[0][2] == c) ||\n   
```\nclass Solution {\npublic:\n    bool iswin(vector<string> &board, char c) {\n        return ((board[0][0] == c && board[0][1] == c && board[0][2] == c) ||\n          (board[1][0] == c && board[1][1] == c && board[1][2] == c) ||\n          (board[2][0] == c && board[2][1] == c && board[2][2] == c) ||\n          (board[0][0] == c && board[1][0] == c && board[2][0] == c) ||\n          (board[0][1] == c && board[1][1] == c && board[2][1] == c) ||\n          (board[0][2] == c && board[1][2] == c && board[2][2] == c) ||\n          (board[0][0] == c && board[1][1] == c && board[2][2] == c) ||\n          (board[0][2] == c && board[1][1] == c && board[2][0] == c));\n    }\n    bool validTicTacToe(vector<string>& board) {\n        int xcnt = 0, ocnt = 0;\n        for(string s: board) {\n            for(char c: s) {\n                if(c == \'X\') xcnt++;\n                else if(c == \'O\') ocnt++;\n            }\n        }\n        if(xcnt != ocnt && xcnt != ocnt + 1) return false;          // X can have equal or only 1 more move than O\n        if(iswin(board, \'X\') && xcnt != ocnt + 1) return false;     // X will win by having one additional move\n        if(iswin(board, \'O\') && xcnt != ocnt) return false;         // since X played first, O can win only when both have made same number of moves\n        return true;\n    }\n};\n```
[]