Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 393 Bytes

458.md

File metadata and controls

26 lines (17 loc) · 393 Bytes

458 Poor Pigs

Description

link


Solution

  • Math Method

Code

class Solution:
    def poorPigs(self, buckets: int, minutesToDie: int, minutesToTest: int) -> int:
        pigs = 0
        while (minutesToTest / minutesToDie + 1) ** pigs < buckets:
            pigs += 1
        return pigs