C++ || Detail Explanation || 1 Line Code|| 100% Fast || Easy Understanding
Explanation: \n\n\nThis question is based on combinatrics. \n\nLets assume that we have p pigs which can give us the accurate result. Now we have\ntotal Round o
Explanation: \n\n```\nThis question is based on combinatrics. \n\nLets assume that we have p pigs which can give us the accurate result. Now we have\ntotal Round of test = (timetoTest/TimetoDie) ie. T tests. \n\nSo for each T test there can be T+1  outcomes that is it can die in 1st or 2nd or Tth oit it means the T cases and the last case is it won\'t die! So total T+1 Outcomes are possible.\n\nNow for each pig we have to go for T+1 outcomes i.e\n(T+1)*(T+1)........*(T+1).\n\nSo T+1 tests rounds are there so for all p pigs the total combination will be (T+1) to the power p i.e (T+1)^p. Now** this total combination should be greater than or equal to N.**\n\nHence  the condition for the answer is going to be \n(T+1)^p >= N\nTaking log on both sides we will get the required answee\np >= log(N)/ log(T+1);\nand hence ceil function is used in the return.\n```\n\n```\nclass Solution {\npublic:\n\nint poorPigs(int buckets, int poisonTime, int totalTime) {\n    return ceil(log(buckets) / log(totalTime / poisonTime + 1));\n}\n};\n```
['C++']