Detect the Winning Move on an N x N Board

Asked at Airwallex · Coding Questions · Difficulty: Medium

Two players take turns placing their marks on a square `n x n` board, in the style of noughts and crosses. A player wins by owning every cell of one full row, one full column or one of the two main diagonals. Build a board object that records each move and says right away whether that move won the game for the player who made it.

Loading the problem…