Google interview question

Make tic-tac-toe board validator