Ad
  • Custom User Avatar

    Resolved

  • Custom User Avatar

    Yeah, output is (23, 23) now. I thought the tests are isolated. Ok, I'll take care about it. Thank you!

  • Custom User Avatar

    It's not a problem in the tests, try calling your function locally like in the tests, that is, one after the other:

    print(longest_slide_down([[3], [7, 4], [2, 4, 6], [8, 5, 9, 3]]))
    print(longest_slide_down([
                [75],
                [95, 64],
                [17, 47, 82],
                [18, 35, 87, 10],
                [20,  4, 82, 47, 65],
                [19,  1, 23, 75,  3, 34],
                [88,  2, 77, 73,  7, 63, 67],
                [99, 65,  4, 28,  6, 16, 70, 92],
                [41, 41, 26, 56, 83, 40, 80, 70, 33],
                [41, 48, 72, 33, 47, 32, 37, 16, 94, 29],
                [53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14],
                [70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57],
                [91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48],
                [63, 66,  4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31],
                [ 4, 62, 98, 27, 23,  9, 70, 98, 73, 93, 38, 53, 60,  4, 23],
                ]))
    

    And see what you get.

  • Custom User Avatar

    "The problem is, memo isn't reset, it keeps its value"
    Is it the solution problem? Then don't understand why.
    Or tests problem?

  • Custom User Avatar

    "Have you tried locally calling your function more than once?"
    Sure, many times, with the same or different pyramids, but one per try.

    "...distinguish between '11' + '10' and '111' + '0'?"
    Didn't think about it. Looks reasonable. The test suite is pretty small, probably need to make it bigger

  • Custom User Avatar

    Have you tried locally calling your function more than once? The problem is, memo isn't reset, it keeps its value. Also point being a concatenation of x + y, how would you distinguish between '11' + '10' and '111' + '0'?

  • Custom User Avatar
  • Custom User Avatar

    share it here?

  • Custom User Avatar

    And what's the code that does that?

  • Custom User Avatar

    Is it possible to get the same result for all the tests? I get 23, which is correct only for sample test #1. It seems like the tasts share it's state, because if I print out the memo dict, then it's the same for all tests. Meanwhile, on my computer I get different results with the same code for different pyramids (e.g 1074 for medium pyramid). Actually, I have another, not optimized solution and it passes all the tests.

  • Custom User Avatar

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

  • Custom User Avatar

    Потрясающая ката. Автору огромное спасибо. Тем кто еще не решил задачу, терпения и удачи. Решение намного проще и короче, чем может показаться изначально.

  • Custom User Avatar

    Maybe adding this example to the description:

         \1\
        4 \2\
       3 4 \9\
    
  • Custom User Avatar

    It literally says "maximum sum of consecutive numbers from the top to the bottom" in the description? At no place the description mentions that it can be reached by picking the larger of two neighbors. The problem is that, for some reason, users do mental mapping between "largest sum" and "larger choice" . If you have an idea how to make users stop doing this, please do tell.

  • Custom User Avatar

    People have been getting confused with this Kata for YEARS and you guys still don't see why is confusing?
    Is confusing because it doesn't clarify that the "longest slide" means reaching the biggest possible number overall, which means that when comparing two numbers, is not enough to just pick the biggest one, since it may lead to a lesser number than taking another path, which implies that at some levels the biggest number for THAT level is not the correct result

  • Loading more items...