Ad
  • Custom User Avatar

    This breaks when the node value is 0.

  • Custom User Avatar

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

  • Custom User Avatar

    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!

  • Custom User Avatar

    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.

  • Custom User Avatar

    Thanks! Yes, it looks like the issue was resolved, possibly by someone else.

  • Custom User Avatar

    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).

  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    Can this issue be marked as resolved? It doesn't look like I can mark this as resolved. Thanks.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Ahh, nice catch. Fixed, thanks!

  • Custom User Avatar

    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).