Your question is Python Helper Function Implementation. 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.
General Dynamics Land Systems mission software may represent an Abrams vehicle procedure as a recipe of named steps. Each step lists the steps that must finish before it can begin. Implement a helper that groups the recipe into execution batches, where every step in a batch can run concurrently and batches execute in order.
Return the batches in deterministic order by sorting step names alphabetically within each batch. Return an empty list if the recipe contains a dependency cycle.
Implement schedule_recipe(steps), where steps is a dictionary mapping a step name to a list of prerequisite step names. Every prerequisite appears as a key in steps. Return a list of lists of strings. Each inner list is one executable batch.
def schedule_recipe(steps):