HashedIn by Deloitte interview question

Write the function for tic tac toe game.