Diagram || Explaination || Logarithm
\n\n\n\nAfter calculating n i.e  testing time/dying time+1\n\n\n0 means the pig does not drink.\n1 means the pig drinks in the first round and die.\n2 means the
![image](https://assets.leetcode.com/users/images/82465548-11ae-427d-8e79-e9165cd4723c_1698566493.2624886.jpeg)\n\n![image](https://assets.leetcode.com/users/images/077f32be-909a-4b5f-a2ed-3318813e05ef_1698566501.0751572.jpeg)\n\nAfter calculating n i.e  testing time/dying time+1\n\n```\n0 means the pig does not drink.\n1 means the pig drinks in the first round and die.\n2 means the pig drinks in the second round and die.\n...\n...\nn means the pig drinks in the n-th round and die.\n```\n\n```\nclass Solution {\npublic:\n    int poorPigs(int buckets, int d, int t) {\n      int n= t/d +1;\n        //n decides what base system to use\n        // ans = log(buckets) with base n \n      int ans= (int)ceil(log2(buckets)/log2(n));\n      return ans;  \n    }\n};\n```\n\n
['C', 'C++']