Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
Then as i said u should change that sentence, because it only confuses
Top-down or bottom-up doesn't matter, there is only one correct answer either way: 1074.
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.
This comment is hidden because it contains spoiler information about the solution
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?
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
The result should be 1064 not 1074, please check
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!
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 ?
Very great kata on dynamic programming and algorithms optimization, well done, congratulations.
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
why not?
please give us a little more explanation to our general mistake
No.
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...