Your question is Graph Traversal for Dependency Trees. 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.
Airbus Skywise services are assembled from modules that may depend on other modules. Given each module and its direct dependencies, return a valid build order that places every dependency before the modules requiring it.
If multiple valid orders exist, return the lexicographically smallest one. If the dependency graph contains a cycle, return an empty list because no valid build can be produced.
Implement resolve_dependencies(dependencies).
dependencies is a dictionary mapping a module name to a list of its direct dependency names.dependencies.[] if the graph contains a cycle.A dependency edge A -> B means A must be built before B.
def resolve_dependencies(dependencies):