We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Mandragora Forest
Mandragora Forest
Sort by
recency
|
95 Discussions
|
Please Login in order to post a comment
The problem statement might throw some people off (it did for me).
Note: You don't need to face the mandragons in order. You can choose to face them in any order. Intuitively, you would choose to face them in increasing size of health (this is because if you choose to save and increase s, you would do so for smaller payout monsters that lead to bigger earnings later on.)
Here is my solution in java, javascript, python, C ,C++, Csharp HackerRank Mandragora Forest Problem Solution
Here is Mandragora Forest problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-mandragora-forest-problem-solution.html
Bruh, this is Greedy I wasted my time in thinking how should I be applying dp : ( trying some kind of 0-1 Knapsack pattern or something else
Please try with Greedy approaches before checking the solution
Here's the solution in Python :
Absolutely agree with you It's One line solution. best tantrik in Raipur