Given a DAG as deps (dict mapping each task to its list of prerequisite tasks), return a valid execution order: every task appears after all of its prerequisites. Among tasks that are simultaneously ready, choose the alphabetically smallest first (so the order is deterministic).
Tasks may appear only as someone's prerequisite (not as a key) — include them. If the graph contains a cycle (no valid order exists), return None.
What the tests check
6 on Run · 7 on Submit01linear chain
02prereq-only tasks are included
03alphabetical tie-break among ready tasks
04diamond resolves to a valid order
05cycle returns None
06tie-break applies at every step, not just among the starting tasks
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.