Ad
  • Default User Avatar

    I only wanted to avoid global variables. Maybe not worth it (but I'm happy I know how to do it now).

  • Default User Avatar

    Concerning the last comment, the final codes depend on the way you build your tree. For example, in the situation of the example, here is a valid tree
    ..*
    ./.\
    a...*
    .../.\
    ..b...c
    which will give a:0, b:10, c:11. Otherwise, you can exchange b and c on the tree (and get a:0, b:11, c:10) and a and the node (and get a:1, b:01, c:00 or a:1, b:00, c:01).

    What you won't get is something as you suggest with a:0 and c:01. Thing is the left-most digit is how you go from the root to the first nodes and a is in another component than b and c (because as they have the 2 smallest frequencies, b and c are paired).

  • Default User Avatar

    This situation is unrealistic. Even with the fastest elevator in the world, there is no way you'll manage to go 10 to the power 3000 (which is roughly the answer to height(4477,10000)...) floors up multiple times so that you can re-use unbroken eggs. (Even just once actually...)

  • Default User Avatar

    Actually, it does follow from that statement. It seems (sorry but the description of this kata is extremely confusing) that the "target floor" is the highest floor from which an egg would not break. If an egg breaks from floor 1, then target floor is 0 which is not "between 1 to this maximum height".

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution