Beeline Interview Question

How to solve a Tic Tac Toe game in code