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.
This comment is hidden because it contains spoiler information about the solution
This test looks wrong. Array has 23 positions and the answer has 36.
snail([[1,2,3,4,5,6],[21,22,23,24],[32,33,34],[36,31],[28,29,30],[12,13,14,15,16]]) -
Expected: '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36]', instead got: '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 31]'
I might be misunderstading..?
For reference I had a bug in my code but somehow that seems to mess with the result in the above assertion.
I read the first three words and got a massive clanging sound in my brain...
My error checking is not what it should be.
Lost on why 1.100 is NaN, if I knew why I coud fix it... Don't want to workaround for the specific value, am I missing something?
Solved it, my knowledge of the RegExp object is a bit sharper now.
Wow a lot of people are stuck, me too!
Been trying to regex word boundaries which works the majority of the time and others it just doesn't 'bc' being my main problem. I see you are being pretty helpful, I'd love to know where I am going wrong.
It's probably just late and I can't think straight. tried the same strings in a regex processor and it works as I would expect..
Last one fails but not much feedback, I am thinking one of the parameters is an object so it needs to recurse but there is no clue. Would be useful if we knew what the response was supopsed to be.
I have been thinking abou this for days, still don't think my solution is too elegant but I beat it in the end!
I have test cases in my current Kata and I get the error 'Test didn't pass: Unknown error'
Test engine is down
Is there an error in the test code?
I am only asking because I get all examples correct except for 'a to a' in the simple arcs section. But the arcs array looks to be missing something (either {start:b,end:a} or {start:a, end: a}) see below.
describe("Simple graph with 1 arc", function() {
var arcs = [
{ start: "a", end: "b" },
]
I like the idea of recusrsive defintely, mine was heavier than this but check this out...
function solution(l){
return l.map(function(x,i){return l[--i]==x-1&&l[i+2]==x+1?'':x;}).join().replace(/,(,)+/g,'-');
}
I was blown away.
Fast too...
I quite liked it, harder than I initially thought (but not too tough for a friday night) it would have been handy to have a dictionary word longer than the pattern. I guess that was the point but totally missed it!