Design Tic-Tac-Toe
Design a `TicTacToe` class for an $n \times n$ board that supports two players. The class should be initialized with the board size $n$, and expose a `move(row, col, player)` method that places a mark for the given player at position $(\text{row}, \text{col})$. The method should return:
- The player number (1 or 2) if that move wins the game.
- `0` otherwise.
A player wins by completing an entire row, column, or diagonal with their marks. You may assume all moves are valid (the cell is unoccupied and the game has not already been won).
**Constraints:**
-
\leq n \leq 100$
- `player` is either `1` or `2`
- $0 \leq \text{row}, \text{col} < n$
- Every call to `move` is on an empty square and the game is not yet over
- At most $n^2$ calls to `move`
**Example 1:**
```
Input:
n = 3
moves: (0,0,1), (0,2,2), (2,2,1), (1,1,2), (2,0,1), (1,0,2), (2,1,1)
Board after each move:
X . . X . O X . O X . O X . O X . O X . O
. . . . . . . . . . X . . X . O X . O X .
. . . . . . . . X . . X X . X X . X X X X
^
Output: [0, 0, 0, 0, 0, 0, 1]
Explanation: Player 1 wins on the last move by completing the bottom row.
```
**Example 2:**
```
Input:
n = 2
moves: (0,1,1), (1,1,2), (1,0,1), (0,0,2)
Board after each move:
. X . X . X O X
. . . O X O X O
Output: [0, 0, 0, 2]
Explanation: Player 2 wins by completing the main diagonal (top-left to bottom-right).
```
Design your solution so that each call to `move` runs in $O(1)$ time.