Back to Practice Dashboard
Competitive ProgrammingEasy

Egg Dropping Puzzle

Learn how to solve the 'Egg Dropping Puzzle' problem. This detailed resource details brute force and optimized approaches.

Problem Statement

Easy

Write a function egg_drop(n, k) that returns the minimum number of trials required to find the critical floor in the worst case, given n eggs and k floors.

Constraints
  • 1 <= n <= 10
  • 1 <= k <= 100

Examples

Example 1
Input
egg_drop(2, 10)
Output
4
Explanation

With 2 eggs and 10 floors, we can find the critical floor in at most 4 trials.

Example 2
Input
egg_drop(3, 14)
Output
4
Explanation

With 3 eggs and 14 floors, we can find the critical floor in at most 4 trials.

Need a Hint?
Define subproblem states, establish the recurrence relation, and use memoization (top-down) or tabulation (bottom-up).
Edge Cases to Watch
  • Empty list or null input variables
  • Single item lists/arrays
  • Extremely large input bounds causing integer or stack overflow

Ready to Solve?

Open the problem in PyRun's browser-based Python editor. Your code runs fully offline — no server required.

Open in Editor