Given a directed graph with n nodes labeled 0 to n - 1, determine whether the graph contains at least one cycle.
Implement a function that returns True if the graph has a cycle, otherwise return False.
n, an integer representing the number of nodes.edges, a list of directed edges, where each edge is a pair [u, v] meaning there is an edge from u to v.def has_cycle(n, edges):