Solution: Egg Dropping Problem
This review provides a detailed analysis of the different ways to solve the egg dropping problem.
We'll cover the following...
We'll cover the following...
Solution 1: brute force
Explanation
When we drop an egg from the floor i, there can be two cases: (1) The egg breaks (2) The egg doesn’t break.
- If the egg breaks after dropping from the floor, then, we only need to check for floors lower than
iwith remaining eggs; so the problem reduces toi - 1floors andn - 1eggs. - If the egg doesn’t break after dropping from the