leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0458.cpp (221B)


      1 class Solution {
      2   public:
      3     int poorPigs(int buckets, int minutesToDie, int minutesToTest) const {
      4         const int tests = minutesToTest / minutesToDie + 1;
      5         return ceil(log2(buckets) / log2(tests));
      6     }
      7 };