C++ || 0 ms || best approach|| 100% Fast || O(1)
Intuition\n Describe your first thoughts on how to solve this problem. \nif you observe the cases for same DieTime and TestTime , the pig requirements increases
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nif you observe the cases for same DieTime and TestTime , the pig requirements increases only at value of buckets which are power of 2 .\nsimilarly observing, let round r = (TestTime)/(DieTime) then the increase in requiements of pig increases by 1 at every value of buckets which are power of (r+1). \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n-> for n==1 , ans would be 0\n-> we will find no. of round of feeding is possible by dividing TestTime by DieTime.\n-> Now we will find the value of log(base(r+1))(n-1)+1 and return it .\n-> we have taken n-1 because if none pig dies then it will be the poisonous we do not to consider for that one.\n**For DP Approach see comment.**\n *DO UPVOTE IF IT HELPS !!!!!!*\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n   O(1)\n- Space complexity:\n- O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\nint log_a_to_base_b(int a, int b)\n{\n    return log2(a) / log2(b);\n}\n    int poorPigs(int n, int Die, int Test) {\n        if(n==1)return 0;\n        int t = Test / Die; int ans =0 ;\n        int x = log_a_to_base_b(n-1, t+1) +1 ;\n\n       \n        return x ;\n        // return ceil((log2(n-1) +1)/ t);\n    }\n};\n```
['C++']