[Community puzzle] X egg problem

This topic is about the puzzle X egg problem.

Feel free to send your feedback or ask some help here!

Hey there! I tried a basic search with memoïzation in Java but this doesn’t work for the last test case. Did anyone make it work in Java? If so, do you have tips? Thanks!

@Romario did you get these test cases from somewhere or did you use your algorithm to calculate them?

The first test case does not match the problem statement part that reads, “One of the floors (from 0 to N) is the highest in the building you can drop an egg from without breaking it.” That guarantees at least one safe floor to drop from, and any floors below that are safe as well. So, you never need to test floor 1 for safety. The 1-egg drop test can begin dropping from floor 2.

That lets you solve 100 floors and 1 egg in 99 drops instead of 100.