Ad
  • Default User Avatar

    You're welcome and congrats on solving!

  • Default User Avatar

    @JPR95 - by the way, since you are new to Codewars, a useful tip for debugging is to print your inputs to console so you can see better what is causing you to fail:

    how to print inputs Troubleshooting guide

    As @Chrono79 said, you will find that some tests are passing you an input that is indeed "unordered", but you still should be able to create the required "snail" pattern from them (because the "labels" of the elements isn't relevant, only their location in the input array - you could use letters instead of numbers and the kata still makes sense.)

  • Custom User Avatar

    That's a problem with your code, not a kata issue:

    JavaScript Completions 17985

    There are two fixed tests in javascript, one where the numbers are ordered in the array, similar to the first example, and another similar to the second example. Random tests contain random numbers. You must follow the snail pattern with them too.