Minimum number of pigs required to find the poisonous bucket | Function to find the minimum number of pigs required to find the poisonous bucket ; Print the result ; Driver Code
function poorPigs ( buckets , minutesToDie , minutesToTest ) { document . write ( Math . ceil ( Math . log ( buckets ) / Math . log ( ( minutesToTest / minutesToDie ) + 1 ) ) ) ; } let N = 1000 , M = 15 , P = 60 ; poorPigs ( N , M , P ) ;