Simplest explanation
First, the pig will die within 15min, not exactly 15min. So we can\'t let pig drink every second.\n\nThe simplest explanation is to check the number of combinat
First, the pig will die **within** 15min, **not exactly** 15min. So we can\'t let pig drink every second.\n\nThe simplest explanation is to check the number of combination of pigs\' life status. \n\nFor example, if mintodie == mintotest, then each pig can only have two life status: live or die in the end. So the number of combination is 2^N. When 2^N is equal or greater than num of bucket, the smallest N is out answer\n\nIf mintotest/mintodie = **K**, for example, mintotest = 60 and mintodie = 15, each pig could have five different status: die at 15,30,45,60 or live in the end. The combination is 5^N. Make 5^N => num of buckets, smallest N is the answer.\n\n```\nbase = minutesToTest/minutesToDie+1\nres = 0\nwhile base**res < buckets:\n\tres += 1\nreturn res\n```\n\n\n
[]