584. Drop Eggs II [LintCode]
There is a building of
n
floors. If an egg drops from thek
th floor or above, it will break. If it's dropped from any floor below, it will not break.You're given
m
eggs, Find k while minimize the number of drops for the worst case. Return the number of drops in the worst case.Example
Given
m
=2
,n
=100
return14
Givenm
=2
,n
=36
return8
public class Solution {
/**
* @param m the number of eggs
* @param n the umber of floors
* @return the number of drops in the worst case
*/
public int dropEggs2(int m, int n) {
// Write your code here
}
}