indegree of length n to store the in-degree count for each node.edges and increment the in-degree count of the destination node.champion to -1 to store the index of the potential champion.indegree array to check for nodes with zero in-degree.champion is already set to a node index. If so, return -1 as there is no unique champion.champion is not set, assign the current node index to champion.champion is not -1, return champion; otherwise, return -1.