Algorithm · Anthropic · Medium
Problem You start with a list of recipes, a list of ingredients for each recipe, and a set of supplies you already have. Each ingredient is either a basic supply or the name of another recipe. To cook a recipe you must have every ingredient it calls for. Once you cook a recipe, that dish becomes available as an ingredient for other recipes. Return every recipe you can eventually cook, keeping the original order from the recipes list. Input Format The input arrives as three…
Checking your access…