125. Egg Dropping: Minimum Trials
HardDynamic programming
A building has floors 1 to floors. There is a threshold floor f (0 ≤ f ≤ floors): an egg dropped from above f breaks, and one dropped from f or below survives and can be reused. You have eggs identical eggs.
Return the minimum number of drops that guarantees finding f in the worst case.
Example 1
Input: eggs = 1, floors = 10 Output: 10
Example 2
Input: eggs = 2, floors = 100 Output: 14
Constraints
1 ≤ eggs ≤ 1001 ≤ floors ≤ 10⁴