Minimum Time Required

  • + 5 comments

    A great question. In case someone is stuck, think of why this is in the "search" section. Could you efficiently search for the number of days it would take to produce the goal?

    n <= 10^5 is the constraint. Which means that our algorithm can be O(n logn).

    Given the number of days, it take O(n) to compute the items produced in those days by n machines. So we have log n searched allowed to find the correct day (where items produced fulfils the goal).

    Does it ring any bells? Ping me if you still have a question.