




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
It's straightforward to check if A or B won or not, check for each row/column/diag if all the three are the same.
Then if no one wins, the game is a draw iff the board is full, i.e. moves.length = 9 otherwise is pending.