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.
The function name is misspelled in JS (should be contourMode).
This comment is hidden because it contains spoiler information about the solution
Interesting Kata. I've discovered a quirk about the javacript
Array.prototype.sort
method, that sometimes re-arranges array items in an unexpected fashion. For example, when implementing the following code, the expected result is returned.However, the longer random examples in this Kata appeared to break this pattern, and equivalent length strings were rearranged in the array after the sort method. I'm not able to explain this behaviour.
Oh, you're right! I called
slice()
on the passed array and the random tests now work fine.Not sure if it was my particular implementation, but I was having trouble with the random empty array tests. In the examples,
[] => [] // expects the empty array
; however, the random tests required[] => [undefined]
. See my code for awkward work-around.Nice Kata! Just had a little trouble understanding the instructions for the skip function; specifically, I didn't know if I should be skipping the next character in the tape or the next valid character in the tape.
Some of the generated test examples are broken. This seems to occur when a cluster of 3 digits is repeated at the very end of the test. The first cluster is caught by the test, but the second is not.
Eg. A string containing
0 153 153 0 407 407
would sometimes expect0 153 153 0 407 713
, but should in fact be0 153 153 0 407 407 1120
.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution