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.
The expression in max_days meant to be an upperbound, 1 is a lower bound for any machines. So the solution could also be in the range [1,machines[0]*goal)
Consider this counterexample;
machines={1,3,5,7} , goal=5
if we set min_days =1*5. then our solution becomes 5.
But the optimal solution is 4 when machine_0 produces 4 and machine_1 produces 1.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Time Required
You are viewing a single comment's thread. Return to all comments →
The expression in max_days meant to be an upperbound, 1 is a lower bound for any machines. So the solution could also be in the range [1,machines[0]*goal) Consider this counterexample; machines={1,3,5,7} , goal=5 if we set min_days =1*5. then our solution becomes 5. But the optimal solution is 4 when machine_0 produces 4 and machine_1 produces 1.