Ad
  • Custom User Avatar
  • Default User Avatar

    Extremely poorly explained.
    Misses the point of programming exercises entirely,
    as programming knowledge is completely secondary
    to the task at hand.

    If you're interested in Katas that involve programming, skip this one.

  • Default User Avatar

    Exactly - if it does not break at 3, you know it will break at 4 since you tested it.
    If you alter the decision tree, you'd have no idea whether floor 4 breaks eggs, you only know that floor 5 breaks eggs and floor 3 does not.

    If it helps, extend your tree with the result - if you have more tries then eggs, you'll reach a result once the last egg breaks, eg. down from 1 you get the result 0, down from 2 you get the result 1,... and to the very right, next to the 10-throw you omitted if no break occurs at 9, the results are 9 or 10.

  • Custom User Avatar

    assume we have 2 eggs and 4 try

    from what i understand, the decision tree behind the answer is that

    down is break, rigth is survive
    4 ----- 7 --- 9
    |       |     |
    1-2-3   5-6   8
    

    the answer is 9

    but if it did not break at 3 or 6 or 8, we know its 1 above it since we already tested 2 above it
    so the decision tree should be

    5 ----- 9 --- 12
    |       |     |
    1-2-3   6-7   10
    

    the answer should be 12

    im not sure if i misunderstand it or i should put it into issue

  • Custom User Avatar

    Am I doing something wrong or are we restricted to using only BigInteger?

  • Custom User Avatar

    suggestion closed

  • Custom User Avatar

    That is really silly then. This should be on mathwars.com, not codewars.com.

  • Custom User Avatar

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

  • Custom User Avatar

    Took me a minute to understand the question, but the test values helped. The values are:

    • n - number of eggs available
    • m - number of drops possible (any more would cause his heart to break)

    So for example if the values were n = 1, m = 100, the answer would be 100. Just start dropping
    your one egg at floor 1 and continue up until it either breaks or you run out of tries. So you can
    give the exact number for any floor up to 100. The actual floor might be 2000, but you can only verify up
    to 100 with one egg. If you start on any other number, for example floor 2, the egg might break. Then
    you know that floor 2 isn't safe, but you aren't sure if floor 1 is safe or not, so you can't
    give a correct answer.

  • Custom User Avatar

    Whether there is an issue or not, this isn't the way to describe it.

    Which language? Which random test? What's the issue with it?

    Oh right, none of that is provided, so... closing.

  • Default User Avatar

    so you're saying there's no issue?

  • Default User Avatar

    I have a problem with random test
    My code work with all values

  • Custom User Avatar

    Thank you! I agree that the description is ambiguous, I specifically went to the discussion board hoping that it wasn't just me xD

  • Default User Avatar

    To whom are trying to solve this kata and landed here looking for hints.
    This kata is a math problem, coding is almost not required. Once you understand the logic it takes 10 minutes to solve it.
    But then you will find out that it needs to be way faster and for that math is the way. The math you need stars with P and finishes with al.
    Do not waste hours, as I did, trying to optimize your solution.

  • Custom User Avatar

    I also dont understand the puzzle. could you give a explanation with lets say 3 egs and 5 tires. or something like that. Can I trow same egg multiple times if it doesnt break? I also doesnt understand how floor number odesnt affect a number of tires? when finding that out, should you just trow egg from random floor and then go up or down depending if it breaks or not?

  • Loading more items...