584. Drop Eggs II [LintCode]
There is a building of
nfloors. If an egg drops from thekth floor or above, it will break. If it's dropped from any floor below, it will not break.You're given
meggs, 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=100return14
Givenm=2,n=36return8
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
}
}