Your question is Detect Dependency Graph Cycles. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Propio's Interpreter Platform represents service dependencies as a directed graph. If service A depends on service B, the graph contains an edge from A to B. A circular dependency can prevent services from starting correctly.
Implement has_cycle(dependencies) to determine whether the dependency graph contains at least one directed cycle.
dependencies, a dictionary mapping each service name to a list of services it directly depends on. Service names are strings.True if the directed graph contains a cycle, otherwise return False.def has_cycle(dependencies):