Cycle Detection Graph Leetcode