LeetCode: https://leetcode.com/problems/find-all-possible-recipes-from-given-supplies/
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.
yeast
0
flour
1
meat
2
recipes=["bread", "sandwich"]
ingredients=Array(2)
supplies=["yeast", "flour", "meat"]
graphEdges=Array(4)
indeg={ bread, sandwich }
queue=["yeast", "flour", "meat"]
res=[]
Step 1 / 6
Step 1:
Build graph ingredient -> recipes and indeg for each recipe.
Focus: select @ [0, 1, 2]