This may be easy if...

  • 0

    I feel as though the problem should give the rate at which a pig can sample each buckets per minute. The way the current problem is makes no sense. The time it takes for a pig to sample a bucket is a very important factor (which is left unknown). So here is what i propose:

    def pigproblem ( buckets, minutesTotest, minutesTodie, pigrate ): 
          #pigrate, the rate at which one pig can sample each bucket (buckets per minute)
          pigs = 0
          while ( pigrate >= ( buckets / ( minutesTotest - minutesTodie) ) ):
              pigs += 1
              pigrate = pigrate / pigs
          return pigs

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.