Build Order
You are given a list of projects and a list of dependencies (pairs where the second project depends on the first). All dependencies must be built before the dependent project.
Find a build order that satisfies all dependencies. If no valid order exists (cycle), return None.
Example:
projects: ["a","b","c","d","e","f"]
dependencies: [("a","d"),("f","b"),("b","d"),("f","a"),("d","c")]
Output: ["f","e","b","a","d","c"] (one valid order)
Hints
solution.py
Python ready
Test Output
▶
Click "Run Tests" to execute your code