Solution for tictactoe