584. Drop Eggs II [LintCode]

There is a building ofnfloors. 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 givenmeggs, Find k while minimize the number of drops for the worst case. Return the number of drops in the worst case.

Example

Givenm=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
    }
}

results matching ""

    No results matching ""