Implement detect_cycles(ll_next, graph) and return the tuple (entry, has_cycle).
ll_next describes a singly linked list: ll_next[i] is the index of the node after node i, -1 means none, traversal starts at node 0, and an empty list has no nodes. entry is the index of the node where the list's cycle begins, or -1 if there is no cycle.graph is the adjacency list of a directed graph (graph[i] lists the nodes with an edge from i). has_cycle is True iff the graph contains a cycle (self-loops count).