Question: I am asked to use 'Python' to answer the question. My solution costs too much memory. Please tell me how to do it more efficiently.
I am asked to use 'Python' to answer the question. My solution costs too much memory. Please tell me how to do it more efficiently.
The economy crisis worldwide affects Santa Clause too, and, as the Christmas getting closer, you must help him save some budget this year. Imagine the Santa is giving presents according to a given wish_list. Each number in such list represents a value of a present wished by a child somewhere in the world. Santa could skip some expensive presents in the excuse of the children wishing for them are too greedy while he can't skip consecutive numbers in the list since doing so will be considered dereliction.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
