Short Problem Definition:
You are planning production for an order. You have a number of machines that each have a fixed number of days to produce an item. Given that all the machines operate simultaneously, determine the minimum number of days to produce the required order.
time complexity is O(N*log(10*9))
space complexity is O(1)
This problem statement is a typical binary search challenge. It has a function (the sum of production) that changes in relation to some linear variable (time).
The bounds can be limited by the minimal and maximal production of each machine in the array. This means that the range is 1-10*9, but for most cases, it will be more constrained. It is a big number, but if the function is fast enough, it can be solved in a reasonable time.
There are 10*5 machines, there are completely independent and we have to visit all of them for each iteration. There is no point in memoizing or preprocessing any values, since they change with every iteration.
Hence the time complexity is O(N * log(10*9)).
P.S I always take forever to get binary search right. I should keep a templated (lambda) version of it available, for problems such as this one.