Tic-Tac-Toe Referee
Given a tic-tac-toe board (X went first; the position arose from legal play), print the verdict: X or O if that player has three in a row, DRAW for a full board with no winner, ONGOING otherwise.
Input: three lines of three characters (X, O or .).
Output: the verdict.
Constraints:
- the position is reachable in legal play
Sample Tests
Input 1
XXX OO. ...
Output 1
X
Input 2
XOX OXO OXO
Output 2
DRAW
Discussion (opens after you solve — no spoilers before)
No comments yet.