Algorithm · Snowflake · Hard
You are given a $$3 \times 3$$ tic-tac-toe position. The position is stored in an array board of exactly 3 strings, each of length exactly 3. Every character is either 'X', 'O', or '.'. Player X makes the first move, after which the players alternate turns. A player wins by occupying an entire horizontal row, vertical column, or diagonal with their own mark. The game stops immediately once such a line is created; no further moves can be made. Given this board, determine its…
Checking your access…