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.
this is my solution, it's a bit complicated but it works =).
defminTime(machines,goal):sum_mach=sum(1/xforxinmachines)days=[1,int(goal/sum_mach)]n=1print(days[-1])whileTrue:sum_prod=sum(days[-1]//x for x in machines)prom=((goal-sum_prod)/2)**n;min_mac=min([x-(days[-1]%x)forxinmachines])*promifsum_prod>=goal:ifprom==1:breakelse:days[-1]=days[-2]n=0else:days.append(days[-1]+min_mac)print(prom,sum_prod)return(int(days[-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 →
this is my solution, it's a bit complicated but it works =).