2023-10-29 16:36:33 +0000 UTC

Poor Pigs

Code

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

        return pigs