Recursion is used when the algorithm for solving the problem is the same as the algorithm for solving part of the problem.
That's just what we have. We need to do a full search of all options and choose the best of them.
Restaurant (part 10)
- 32
Locked
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
ugabuga
14 October 2022, 12:05
Absolutely innapropriate difficulty at this level, especially given the meager task explenation. The solution shows multiple additional methods and classes used that are not hinted at anywhere. Please improve the descriptions and info in the conditions.
0
LuisRC
9 September 2022, 17:22
Too hard to get it implemented for me. I don't know whether the instructions for the task were not well explained or because I was not able to follow them appropriately.
Finally, and after two days chewing on the task I decide to go to the solution and to try to understand how it was implemented.
I feel a bit disappointed with myself for not being able to implement it, but I have to move forward and to improve my skills.
0
Justin Smith
10 July 2022, 15:24
This proved be one of the hardest things I've ever tackled here. Figuring out how to approach the recursion here is challenging because the constraining factor for building the sequence of advertisements is time, but when optimizing the constraining factor is revenue. This is a really good learning experience, and I suggest after you find a workable solution, review the official solution to see how it might have been done differently.
Average number of attempts is 7.61, and only 160 people have completed. If you are having a difficult time, you're in good company.
That said, I was really put off with one aspect of this task. Some of the essential instructions for what you are supposed to do are in the previous part, and not repeated here. They tell you instead to refer to the previous part. Why not just put the instructions in the part they are relevant to? Makes no sense. Also, worth pointing out that each part of these large tasks overwrites the conditions file so there is no way to review the previous part's conditions from within Intellij. You have to come back to the website to find the conditions.
0