Longest Cycle In A Graph Leetcode