You are given a list of recipe names and the list of ingredients needed to prepare each recipe.
Some ingredients are already available to you in unlimited quantity.
A recipe can act as an ingredient for another recipe once it has been prepared.
Return all the recipes that can be successfully prepared using your initial supplies and any recipes you manage to make along the way.
You may return the result in any order.
Input: recipes = ["cake"] ingredients = [["flour","sugar","milk"]] supplies = ["sugar","flour","milk","butter"]
Output: ["cake"]
Input: recipes = ["juice","fruit_salad"] ingredients = [["apple","water"],["juice","banana"]] supplies = ["water","apple","banana"]
Output: ["juice","fruit_salad"]
Input: recipes = ["noodles","soup","ramen"] ingredients = [["flour","water"],["water","salt"],["noodles","soup"]] supplies = ["water","flour","salt"]
Output: ["noodles","soup","ramen"]
Accepted:
Submission: