Ad
  • 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

    Needs update to GHC 9.2.x.

    Syntax / indentation now gives compilation errors

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar
  • Default User Avatar

    I got a question... I know there are some different ways somenone can solve this problem... I choose the dynamic programming just to practise it. Despite the fact that, I follow very carefully the theory and some articles I always take time execution error. Is there any way to solve this problem using dynamic programming or i should look for another way to approach the problem?

  • Custom User Avatar

    This seriousTests case is killing me. I can't figure out how to optimize my solution enough to pass.

    I've got the obvious case of m <= n covered to knock out half the calculations.
    I've also got m - n == 1, m -n ==2 and m = 2n + 1 to knock out more calculations but I cannot figure out how to reduce the calculations when m is much greater than n.
    Can someone give me a hint?

  • Default User Avatar

    I'm still trying to solve it, but i guess is based on https://brilliant.org/wiki/egg-dropping/ so i suggest to be add to kata's description.

  • Default User Avatar

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

  • Custom User Avatar

    Description code blocks made only for haskell, missing other languages.

  • Custom User Avatar

    I have no idea how to get 105 out of 2 eggs and 14 tries. Is it allowed to give some explanation?

  • Custom User Avatar

    Question says: target floor can be any floor between 1 to this maximum height?
    Some of the answers are '0'

    This doesn't make any sense. For the case where you have no eggs, the max height should be 1.
    Either that or the target floor should be any floor between 0 and the max height.

  • Default User Avatar

    its too vague, could you please add another example (below 7 eggs 20 tries)
    i get 105 for 14 tries 2 eggs but for 7 eggs and 20 tries, i get a little more than 137979,
    i tested some cases and it seems to work.
    could it be that 137979 is not the actual maximum? maybe the boundaries(where an egg, each try is supposed to be dropped from) werent counted?

  • Default User Avatar

    Another question in the same vein as some below: running this in C#, getting correct answers, but the full test suite times out.
    For n=20000, m=30000 (above the test limit), this still only takes 808ms. How much faster does it need to be?
    Edit: down to 640ms, still no luck.

  • Custom User Avatar

    I'm afraid there is something bad with your golang runtime env.
    When I ran my code locally (e.g. Height(311, 10131) ) it calculated the proper result 71692....6927, but in codewars environment the same code gave 0.

  • Loading more items...