bucket=4, only 2 pigs is needed for 1 pass?


  • 0
    W
    This post is deleted!

  • 0
    L

    Number buckets from 0 to 3

    t=0
    p0: [0,1] (pig 0 drinks from buckets: 0 and 1)
    p1: [0,2]

    let pn be true if pig #n is dead.

    !p0 && !p1 => 3
    !p0 &&  p1 => 2
     p0 && !p1 => 1
     p0 &&  p1 => 0

Log in to reply
 

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