Your question is Task Ordering with Dependencies. 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.
Given a list of task names tasks and a list of dependency pairs dependencies, return a valid execution order of all tasks. Each dependency [a, b] means task a must be completed before task b. If no valid ordering exists because the dependency graph contains a cycle, return an empty list.
def find_task_order(tasks, dependencies):