Ad
  • Default User Avatar

    Im getting a time out failure with no apparent issues

  • Default User Avatar

    I should such katas should be deleted as an examples of bad description, bad style (why on Earth author is using the name which is used in JS to push data to the end of the sequence to push it to beginning?) and bad code.

  • Default User Avatar

    Отличный ката. Спасибо автору.

  • Default User Avatar

    I made two forks that address mutability:

    1. Immutable dataclass Node - being immutable makes it very simple
    2. Check for mutation - complicated mess, obviously

    Both expect specifically IndexError. Unclear whether that change should be made though. It's not necessarily incorrect by codewars standards to raise an unspecified exception, and this breaks the vast majority of solutions, including ones that I would consider completely correct with the current spec.

  • Default User Avatar

    Unspecified. The choices of excption type look strange across the board. java accepts any exception type according to description (haven't looked at tests) and C# doesn't use IndexOutOfRangeException which I assume is more appropriate and PHP might have something like that exception too instead of InvalidArgumentException .. OutOfRangeException looks to be a thing. Ruby accepts both throw and raise for some reason.

    Some languages return the data which seems more in line of the intent of the kata, while others the entire node, but don't bother checking if it's the correct node.

    This is fine.

  • Custom User Avatar

    no that is.. correct. it'll cause a throw when a throw is asked for

    WAT. No way it causes the correct type of error?

  • Default User Avatar

    if you look at my (python) solution though, THAT is incorrectly passing, as it doesn't return the nth node, but a node containing the value that the nth node contains

    this issue probably applies to most if not all languages.

    one might argue that it's out of scope. it's not. they ask for the node, not the data. if they wanted the data they should have asked for the data. and then test for what's asked for. nor is it a nitpick about python's concept of identity. this function spec is similar to drop, but that is not at all what my solution does.

    bonus issue: poor formatting in python's initial code. never fails to annoy me.

  • Default User Avatar

    no that is.. correct. it'll cause a throw when a throw is asked for which otherwise wouldn't happen.

  • Custom User Avatar

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

  • Custom User Avatar

    Very challenging kata, congratulations, well done.

  • Custom User Avatar

    This took me quite a while, I only have great amount of experience in logical katas that use functions only. But had a trickle with OOP and Class related katas. Great that I can practice my weaknesses with this kata.

  • Default User Avatar

    Gosh. Younger me was an asshole. xd
    Unnecessary "RTFM".

  • Custom User Avatar

    Concepts are correct, names are wrong. Nothing to be done about it though.

    Closing.

  • Custom User Avatar

    push is specified correctly, after that's, it's just a name. "push" is not even the only misname in there. but I don't think any of this is going to be changed now.

    Closing.

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Loading more items...