Loading problem…
You have k identical eggs and a building with floors numbered 1 through n. There is an unknown highest safe floor f, where 0 <= f <= n. An egg breaks when dropped above f, and survives at or below f.
A move drops one unbroken egg from a chosen floor. A broken egg cannot be reused; a surviving egg can. Future drops may depend on earlier outcomes. Return the fewest moves needed to determine f with certainty in the worst case.
Example 1:
Example 2:
Example 3: