Ad
  • Custom User Avatar

    This is how you reach 1074:

    75+64+82+87+82+75+73+28+83+32+91+78+58+73+93 = 1074

    I fail to see what's confusing. Addition is commutative btw, it doesn't matter in which order you add them. The test is fine as it is.

  • Default User Avatar

    Then as i said u should change that sentence, because it only confuses

  • Custom User Avatar

    Top-down or bottom-up doesn't matter, there is only one correct answer either way: 1074.

  • Default User Avatar

    The result should be 1064 and not 1074, the other answers to this problem is that there is another way to get 1074, but the issue is on the sentence that says "" Let's say that the 'slide down' is the maximum sum of consecutive numbers from the top to the bottom of the pyramid. "" Where it clearly says that the sum should be done FROM the top TO the bottom, so ill sugest that or the result of the test should be changed to 1064 or modify the sentence.

  • Custom User Avatar

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

  • Custom User Avatar

    So I'm managing to get the fabled '1074' with the medium pyramid and passing both tests in the editor, however I'm struggling with figuring out an early return to the code if a possible solution has been found.

    Just to check my understanding, is it better to start at the bottom of the pyramid and work up, instead of going from the top and working down?

  • Custom User Avatar

    No, and it's been asked and answered many times below, please check.

    This is how you reach 1074:
    75+64+82+87+82+75+73+28+83+32+91+78+58+73+93 = 1074

  • Default User Avatar

    The result should be 1064 not 1074, please check

  • Custom User Avatar

    Good kata for dynamic programming! It's may be fun, but I write initial idea in 5 minutes and check whole 2 hours why this isn't works. By the end it being logical error in choosing next index. So be carefully, index in array works not the same as left and right pointer in the tree!

  • Default User Avatar

    in the medium pyramid this the path : 75+64+82+87+82+75+73+28+83+32+91+78+58+73+93 = 1074
    for example in 32 value is there 9 possible paths or 4 paths ?

  • Custom User Avatar

    Very great kata on dynamic programming and algorithms optimization, well done, congratulations.

  • Custom User Avatar

    interesting kata! I liked it. solution was simple, but takes about 5-6 hours. but I think example in description is not good, you need to analyze result from middle pyramid

  • Custom User Avatar

    why not?
    please give us a little more explanation to our general mistake

  • Custom User Avatar
  • Custom User Avatar

    need to fix (as you already know) problem with the result:
    second test result (checked by hand) - 1064, not 1074!
    Maybe it's a mistake or another thing, idk...

  • Loading more items...