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.
Resolved
Yeah, output is (23, 23) now. I thought the tests are isolated. Ok, I'll take care about it. Thank you!
It's not a problem in the tests, try calling your function locally like in the tests, that is, one after the other:
And see what you get.
"The problem is, memo isn't reset, it keeps its value"
Is it the solution problem? Then don't understand why.
Or tests problem?
"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
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'?This comment is hidden because it contains spoiler information about the solution
Sure, but read this first: https://docs.codewars.com/training/troubleshooting#post-discourse
share it here?
And what's the code that does that?
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.
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!
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!
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:(((
"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...