You are given k identical eggs and a building with n floors. Determine the minimum number of moves that you need to find the critical floor f with certainty.
Examples
Input:k = 2, n = 6
Output:3
Drop first egg from floor 3. If breaks, test 1 and 2. Else drop from 5, etc.
Constraints
• 1 <= k <= 100
• 1 <= n <= 10000
Complexity Analysis
Time
O(k * m)
where m is the minimum number of attempts.
Space
O(k * m)
DP array storing max reachable floors for (moves, eggs).