Your question is Graph Traversal With Recursion. 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.
Rippling may need to install a selected set of apps while automatically including every app they depend on. Given an app dependency graph and requested apps, return a deterministic order in which all required apps can be installed, with every dependency appearing before the app that requires it.
Use recursive depth-first traversal. If a circular dependency exists among the required apps, return an empty list.
Implement get_install_order(app_dependencies, requested_apps).
app_dependencies is a dictionary mapping an app name to a list of direct dependency names.requested_apps is a list of app names to install.app_dependencies is treated as having no dependencies.[] if the required subgraph contains a cycle.def get_install_order(app_dependencies, requested_apps):