Problem of the Day
Monday, September 21, 2026
Problem:
A grid can be represented by a single list of values, given in order as shown:
| 0 | 1 | 2 | 3 |
| 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 |
So the 4×4 grid
0001
0210
2110
2202
could be written as
0001021021102202
Now consider a tic-tac-toe game played on a 3×3 grid, where X represents a square marked by one player, 0 represents a square taken by the other player, and a dot . represents a square that hasn't been played yet. A player wins by marking three in a row (vertically, horizontally, or diagonally). Which of the following strings represent a game won by player X?
XO.XOO.OX.XOXO..XOOX.OOXOX...XOXOXOO
The correct answer is d.
By examining that string, we can see that the third position in the first row, the second position in the second row, and the first position in the third row all have an X, indicating a win for that player.