Minimum number of pigs required to find the poisonous bucket | Python program for the above approach ; Function to find the minimum number of pigs required to find the poisonous bucket ; Prthe result ; Driver Code
import math NEW_LINE def poorPigs ( buckets , minutesToDie , minutesToTest ) : NEW_LINE INDENT print ( math . ceil ( math . log ( buckets ) // math . log ( ( minutesToTest   \ // minutesToDie ) + 1 ) ) ) ; NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT N = 1000 ; NEW_LINE M = 15 ; NEW_LINE P = 60 ; NEW_LINE poorPigs ( N , M , P ) ; NEW_LINE DEDENT