HackerRank ULTIMATE TIC-TAC-TOE implementation