Limited time: AI code review, hints, mock interviews, whiteboard analysis, and all Pro features are unlocked. Enroll

Super Egg Drop

Hard

Topics
MathBinary SearchDynamic Programming

You are given a identical eggs and access to a building with b floors. An egg breaks if dropped from a floor at or above some unknown threshold f (0 <= f <= b) and survives below it. Return the minimum number of moves needed to determine f with certainty in the worst case.

Example 1

Input:  a = 1, b = 2
Output: 2

Example 2

Input:  a = 2, b = 6
Output: 3

Example 3

Input:  a = 3, b = 14
Output: 4

Constraints

  • 1 <= a <= 100
  • 1 <= b <= 10^4
Run ⌘' · Submit ⌘⏎
SensAI SensAI
Beta
Listening...
Tap mic to stop voice mode

Unlock AI Features

One click to activate - no payment, no credit card. Just sign in and you're in.

AI code review and hints
SensAI chat assistant
AI mock interviews
Whiteboard analysis
100% free during early access