The cap that starts at 1
transcript
Fit the files into the nights. Search the smallest cap. Where should it start?
Take one file of size ten, and one night. The answer should be ten. A search from one returns one. Starting at ten returns ten.
The check puts a file into a night. It does not ask if the file fits. So small caps look feasible.
Make the low bound the largest file. Make the high bound the total size. Test the check at both ends.
With the right bound, all one thousand random inputs agree. Start at one, and seed two fails. One file of two returns one.
Test one file by itself. Test one night, and many nights. Test the largest file alone.
A hundred thousand files can total ten to the eleven. Trying every cap is far too slow. A search needs about forty steps.
Start at the largest file. Test a one-file input. Full breakdown in the lecture.