Using DFS with Color/State Marking - Cycle Detection | OneNoughtOne