Problem Statement
Write a program to check the winner of a 3x3 Tic-Tac-Toe board (0=Empty, 1=X, 2=O). Print 1 if X wins, 2 if O wins, or 0 otherwise.
DEMO-C-32 โข Programming in C
Write a program to check the winner of a 3x3 Tic-Tac-Toe board (0=Empty, 1=X, 2=O). Print 1 if X wins, 2 if O wins, or 0 otherwise.
Input: Dimensions N M followed by the matrix elements.
Output: The formatted result as specified.
Submit runs every public testcase in this browser. Results and code never leave this device.
3 3 2 2 2 1 2 1 2 1 2
2
3 3 2 2 0 2 1 1 2 1 0
2
3 3 1 1 0 2 0 0 0 1 1
0
3 3 0 2 0 1 1 0 1 1 1
1
C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.
/workspace/question