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.
- Minimum Time Required
- Discussions
Minimum Time Required
Minimum Time Required
Sort by
recency
|
153 Discussions
|
Please Login in order to post a comment
why is this TLE? I am using binary search and the last for loop -- couldn't possibly go too much back.
The binary search is certainly a great idea, but solutions I see all start from 0 or 1. The minum days is fastest-machine/number-of-machines * item_targets and the maxium days is slowest-machine/number-of-machines * item_targets:
JS binary search
JS Solution
If
minDays += 1
instead ofminDays = midDays + 1
is used, the time complexity would exceed the limit. Can anyone explain why?this is my solution, it's a bit complicated but it works =).