Amazon interview question

question implementing tic tac toe problem