You are given k identical eggs and a building with n floors numbered from n.
There exists a floor f satisfying f n such that:
Any egg dropped from a floor strictly higher than f will break.
Any egg dropped from floor f or below will not break.
In each move, you can choose any floor x where x n and drop an unbroken egg from it. If the egg breaks, you can no longer use it. If the egg does not break, you can reuse it in future moves.
Return the minimum number of moves required to determine the exact value of f with certainty under the worst case scenario.
Constraints:
k
n
You are given k identical eggs and a building with n floors numbered from n.
There exists a floor f satisfying f n such that:
Any egg dropped from a floor strictly higher than f will break.
Any egg dropped from floor f or below will not break.
In each move, you can choose any floor x where x n and drop an unbroken egg from it. If the egg breaks, you can no longer use it. If the egg does not break, you can reuse it in future moves.
Return the minimum number of moves required to determine the exact value of f with certainty under the worst case scenario.
Constraints:
k
n