Search the answers, not the data.
transcript
A moderator reads posts every hour. How slow can the rate be? The queues are not sorted. But the rates are ordered. Let me show you the idea.
Write a check for one rate x. Read the queues once. Add the hours, and compare. That is the whole check. Write it as its own function. Test it before you search.
The limit is six hours. Rate fifteen needs eight. Rate twenty-two needs seven. Rate twenty-three needs six. It fits. Higher rates only fit more easily. So twenty-three is the answer.
A slower rate needs more hours. A faster rate keeps fitting. So fits turns from false to true once. This is the order the search needs. Without it, halving is not safe.
Capacities reach a hundred billion. The search needs only thirty-seven passes. Trying every capacity would never finish.
Write the check. Search the values. Use 64 bits for sums. Full breakdown in the lecture.