Question: Task 1 You are given N recipes, the K - th of which is represented by a string A [ K ] . Each letter
Task
You are given recipes, the th of which is represented by a
string AK Each letter of the string represents a single unit
of an ingredient: for example, recipe "toast" requires two
ur its of ingredient and one unit of ingredients and
Yourare also given a list of available ingredients represented
by a string S Which recipes can be prepared using
ingredients from the list?
Wite a function:
def solutionA S
given an array A consisting of strings representing the
recipes, and a string S representing the list of available
ingredients, returns the number of recipes that can be
prepared using available ingredients.
Examples:
Given "toast", "bread", "breada", "cheese" and S
"abcdeeehrs", the function should return With our
ingredients, recipes "bread" and "cheese" can be prepared
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
