leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
0458.cpp (221B)
0 class Solution {
1 public:
2 int poorPigs(int buckets, int minutesToDie, int minutesToTest) const {
3 const int tests = minutesToTest / minutesToDie + 1;
4 return ceil(log2(buckets) / log2(tests));
5 }
6 };