[Java] Runtime - Faster than 100% ; Memory - Less than 100% ; Very easy solution with comments!!!
\nclass Solution {\n    char[] nBoard = null;\n    //This matrix is used to find indexes to check all possible winning triplets in board[0..8]\n    int[][] win 
```\nclass Solution {\n    char[] nBoard = null;\n    //This matrix is used to find indexes to check all possible winning triplets in board[0..8]\n    int[][] win = new int[][]{{0,1,2},{3,4,5},{6,7,8},{0,4,8},{2,4,6},{0,3,6},{1,4,7},{2,5,8}};\n                                \n\n    //Convert 1D String array to 1D char array                             \n    public boolean validTicTacToe(String[] board) {\n    \tnBoard = new char[9];\n    \tint k=0 ;\n\t    for(int i=0;i<3;i++){\n\t        for(int j=0;j<3;j++){\n\t            nBoard[k]=board[i].charAt(j);\n\t            k++;\n\t        }\n\t    }\n\t    return isValid(nBoard);\n    }\n    \n        \n    boolean isValid(char[] board){\n    \t//Count the numbers of X\'s and O\'s in the given board\n        int xCount=0, oCount=0;\n        for(int i=0;i<9;i++){\n            if(board[i]==\'X\'){\n                xCount++;\n            }\n            if(board[i]==\'O\'){\n                oCount++;\n            }\n        }\n        \n        //Since we have to start with \'X\', xCount has to be equal to oCount or 1 more than oCount\n        if(xCount==oCount || xCount==oCount+1){\n        \t//Check if \'O\' is winner\n            if(isWin(board,\'O\')){\n            \t//Check if \'X\' is winner, both cannot be winner \n                if(isWin(board,\'X\')){\n                    return false;\n                }\n                //if \'O\' is winner it\'s count has to be equal to \'X\'\n                return xCount==oCount;\n            } \n            \n            //if \'X\' wins, then it\'s count has to 1 greater than \'O\' count\n            if(isWin(board,\'X\') && xCount!=oCount+1){\n                return false;\n            }\n            \n            return true;                \n        }\n        return false;            \n    }\n    \n    //Return true if char \'c\' wins, \'c\' can be either \'O\' or \'X\'\n    boolean isWin(char[] board, char c){\n        for(int i=0;i<8;i++){\n            if(nBoard[win[i][0]]==c && nBoard[win[i][1]]==c && \n               nBoard[win[i][2]]==c){\n                return true;\n            }\n        }\n        return false;\n    }\n}\n//Credits : GeeksForGeeks(https://www.youtube.com/watch?v=RqOFx7Waehc)\n```
[]