Egg Drop Attempts Problem

Egg Drop Attempts Problem — ExecCode Hard DSA Practice

Solve the Egg Drop Attempts problem on ExecCode. Free online hard DSA practice in DP. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You have k identical eggs and a building of n floors. A critical floor f exists: eggs break from f and above. Find f in the worst case with the fewest drops. Return the minimum number of moves required in the worst case. You are given: k — eggs >= 1 n — floors >= 1 Return integer moves. With 1 egg you must scan linearly: answer is n.

Examples

Input {'k': 1, 'n': 2}; Output 2. Input {'k': 2, 'n': 6}; Output 3. Input {'k': 3, 'n': 14}; Output 4

Constraints

A broken egg cannot be reused You may choose any floor next based on previous outcomes

Practice Egg Drop Attempts free on ExecCode. Browse DSA problems, topic map, and placement guides.