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

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

  • 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

    And finally I'm done!!! Found a couple of bugs in solution logic (lack of extra loop).

    The clue was extreme logging/printing when debugging move by move and even shot by shot!

  • Custom User Avatar

    And finally I'm done!!! Found a couple of bugs in solution logic (lack of extra loop)

    The clue was extreme logging/printing when debugging move by move and even shot by shot!

  • Custom User Avatar

    But still of by one sometimes in the random tests... :/

    It's seems I bumped into the same issue. I pass all the test except 2-3 random tests when the result is different by 1.
    Two different solutions. But probably I implement the same bug twice. BTW, with the map you posted above. I think I don't understand the shooting timing properly or... I don't know(. And can't find the clue in the instructions and comments.
    Could you recall the kata and give me some hint? Though 7 years have passed:(((

  • Custom User Avatar

    "even if the targeted enemy has been killed by a previous (in the alphabetic order) turret, the shot is counted"
    Don't understand( Could you clarify please?

  • Loading more items...