Question: This is a more challenging problem that will require you to take your time and design a solution. We have a scenario where we have
This is a more challenging problem that will require you to take your time and design a solution. We have a scenario where we have high value flowers, low value flowers, and greenery the decorative leaves and accessories. Given a budget, we want to spend our entire budget to create a bunch of flowers. Write a function makebunchhigh low, green, budget takes integer for number of high, low and greenery items, and a budget, and returns a list of the flowers used to make the bunch.
There are a number of rules
High value flowers which cost each, and a maximum of can be used, regardless of how many flowers are available.
Low value flowers cost each, and any number can be used
Greenery costs each, and a bunch needs a minimum of items of greenery, with no
maximum
The entire budget must be used.
If a bunch cannot be created within the rules and there is budget left over, then return an
empty list
If a bunch cannot be created due a a lack of flowers, return an empty list makebunch
Here, we input high values, low values, greenery, and a budget of The resulting output is high value flowers low values flowers, and greenery items
makebunch
Outputs large flowers low value flowers and pieces of greenery
makebunch
Here, there is not enough greenery to satisfy the minimum rules, and so an empty list is returned.
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
