Algorithm for Connect 4