Sankey Solutions interview question

tic ac toe