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 breaks when the node value is 0.
This comment is hidden because it contains spoiler information about the solution
Very clean code here, well done. I was just wondering, is it necessary to create new Node instances? This seems like it might be adding additional space complexity, unnecessarily. I see a lot of other solutions out there doing this as well, and I don't mean to single you out, but your solution was listed first. I think it might be more efficient to just point the existing nodes to their new nodes instead of creating new ones. Thanks!
I noticed similar behaviour yesterday when I completed 2 kyu kata (having 3 kyu) - the honor increased only by 1 when I expected 10. The honor increased appropriately with the next completed kata.
Thanks! Yes, it looks like the issue was resolved, possibly by someone else.
Thanks for the modification. I marked this kata as "ready". As I didn't label my original question as an issue, I believe there's nothing to resolve (at least I don't see the possibility in the reply).
No worries. Thanks for the feedback. That's why this is beta :)
I reverted the return value back to the actual node. Unfortunately, this has caused some of the Python solutions to break, but I think it makes more sense to return the node rather than the data.
I think you may be able to reply and check the "mark issue as resolve" checkbox?
Sorry for nitpicking, but... The kata's name is "get nth node", not the node value. I suggest to modify the kata details instead of the test cases (ie. to describe that you expect to find the ntn node and let the test cases verify the function returns the node). The test case modification you made just invalidated some good solutions that had been already submitted.
Anyway, it's your kata and the discrepancy between the details and test cases is resolved. If I need to resolve it somehow (ie. to click somewhere), please tell me. This was my first comment here on codewars and I don't know the good customs yet.
Can this issue be marked as resolved? It doesn't look like I can mark this as resolved. Thanks.
Cool, thanks. Fixed. I couldn't find any language style guides on CodeWars, so I was using the naming conventions that I use at work. I should have known this because the CW Python test framework uses underscores. I'll stick with the underscore function/method convention.
Ahh, nice catch. Fixed, thanks!
The descriptions says "...and returns the data value stored in the node...", while the unit tests expect the node to be returned (in JavaScript kata).