NeetCode #31LC-348MediumArrays & HashingNC Algo100
← Back to All Problems

#31 · #348 · Design Tic-Tac-Toe(设计井字棋)

📌 Problem Statement & Constraints

Design a Tic-Tac-Toe game on an n x n board. Implement move(row, col, player) which records the move and returns the winning player (1 or 2) if this move completes a row, column, or diagonal; otherwise return 0. Constraints: 2 <= n <= 100; moves are always valid and always placed on an empty cell.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!