aboutsummaryrefslogtreecommitdiff
path: root/poor-pigs.cpp
blob: 745558369bdc23b3b9b3c15386084c51af9cd07b (plain)
1
2
3
4
5
6
7
8
#include "leetcode.h"

class Solution {
public:
  int poorPigs(int buckets, int poisonTime, int totalTime) {
    return ceil(log(buckets) / log(totalTime / poisonTime + 1));
  }
};