01 · Question
Given recipes and their ingredient lists, and initial supplies, return all recipes you can make. A recipe becomes available when all its ingredients are available.
02 · Analysis
Count every distinct ingredient, including ingredients that are themselves recipes. Build ingredient -> waiting recipes, then publish initially supplied items and recipes requiring nothing. Each item becomes available once. Decrement a waiting count only when that ingredient is published; reaching zero unlocks the recipe. Missing ingredients and cycles without an available starting item never unlock. With R recipes, I ingredient entries and S supplies, time and space are O(R+I+S) under expected constant-time hashing.