Leetcode Problem 1884. Egg Drop With 2 Eggs and N Floors

1884. Egg Drop With 2 Eggs and N Floors

Leetcode Solutions

Optimal Drop Strategy with Mathematical Insight

  1. Initialize the number of moves to 0 and the current floor to 0.
  2. Increment the number of moves by 1.
  3. Increase the current floor by the number of moves.
  4. If the current floor is less than or equal to n, go back to step 2.
  5. Once the current floor exceeds n, return the number of moves as the result.
UML Thumbnail

Dynamic Programming Approach

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...