Leetcode 2115: Find All Possible Recipes from Given Supplies
In this problem, we are trying to figure the list of recipes that we can make out of a list of ingredients in unlimited quantity. The difficulty comes from the fact that in the list of ingredients necessary for each recipe, there can be another recipe itself.
You have information about
ndifferent recipes. You are given a string array
recipesand a 2D string array
ithrecipe has the name
recipes[i], and you can create it if you have all the needed ingredients from
ingredients[i]. Ingredients to a recipe may…