Two eggs, 100 floors
You have two identical eggs and a 100-floor building. There is some highest floor from which an egg can drop without breaking. A broken egg cannot be reused; an unbroken one can.
What is the fewest drops that always finds that floor, in the worst case?
Show hint
If the first egg breaks, you must check the floors below it one by one with the second egg. So each time you drop the first egg and it survives, your next jump should be one floor shorter.
Show solution
14 drops.
Drop the first egg from floor 14. If it breaks, test floors 1 to 13 one at a time: 14 drops at most. If it survives, go up 13 floors to 27, then 12 more to 39, then 50, 60, 69, 77, 84, 90, 95, 99, 100. Wherever it breaks, the floors left to check with the second egg keep the total at 14 or fewer.
14 works because 14 + 13 + ... + 1 = 105 ≥ 100, while 13 + 12 + ... + 1 = 91 is too few. A dynamic programming solution confirms it.
Want a problem like this every day? See today's problem and keep a streak going.