package leetcode;

/**
 * https://leetcode.com/problems/poor-pigs/
 */
public class Problem458 {
    public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem458 prob = new Problem458();
        System.out.println(prob.poorPigs(1000, 15, 60)); // 5
    }
}

package leetcode;

/**
 * https://leetcode.com/problems/poor-pigs/
 */
public class Problem458 {
    public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
        // https://leetcode.com/problems/poor-pigs/discuss/94266/Another-explanation-and-solution
        int pigs = 0;
        while (Math.pow((minutesToTest / minutesToDie + 1), pigs) < buckets) {
            pigs += 1;
        }
        return pigs;
    }
}

Solve problem 458