Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • 9571508?v=3

    Thanks jamad.

  • 949913?v=4

    Updated the test cases for javascript so that mutation of input data is allowed.

  • 949913?v=4

    Updated the test cases for python so that mutation of input data is allowed.

  • 18171520?v=3

    Doing testing invulnerable to input modification is definitely better kata design ( and explicitly failing solutions that modify inputs is better still ). But ultimately solvers are responsible for not mutating their inputs themselves ( or - yes I sound like a broken record; it's as tiresome to me as it probably is to you - you deserve whatever you get ). A warning should not be necessary, but it might prevent most of the endless f*cking issues by solvers who are still learning this ( generously deleted "clueless" here ).

    I'm not seeing that downvote BTW. I ( though I ) had one earlier on my post below, but I'm not seeing it now either.

  • 9571508?v=3

    I'm not sure if there should be a warning about not mutating the input, getting the expected value first/passing a copy to the user or doing nothing and leaving it as it is. Wondering about the downvote on my previous post, I see no reason for it, but, there's nothing I can do about it.

  • 18171520?v=3

    Not a kata issue then. Closing.

  • 32236948?v=4

    See the issue above, plz.

  • Profile pic

    Thank you. It worked now!

  • 9571508?v=3

    You're mutating the input array, affecting the expected values.

  • Profile pic

    Hello. After I click 'Attempt' it is expecting a sorted array no matter what. For example Expected: '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]', instead got: '[9, 17, 3, 16, 10, 1, 15, 7, 8, 12, 13, 2, 4, 11, 5, 14, 6]', although the expected array is not the correct one. Can you check please?

  • 949913?v=4

    updated the description on behalf. Thanks.

  • 18171520?v=3

    Speeling error:

    it's

  • 18171520?v=3

    Yes, the random tests are vulnerable to input modification. No, if you do not modify the input the tests are not wrong. Yes, if you modify the input you deserve whatever you get.

    Note that [].sort modifies its input.

    Not a kata issue. Closing.

  • 949913?v=4

    Translated it into Python.

  • 27006831?v=4

    Same error without modifying the input in JS :

    [ 19, 72, 16, 50, 25, 92, 80, 23, 40, 63, 26, 99, 42, 18, 68, 3, 75, 96 ]

    Expected: '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]', instead got: '[15, 6, 17, 9, 13, 3, 4, 14, 11, 8, 12, 1, 10, 16, 7, 18, 5, 2]'

  • Loading more items...