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.
like it
This comment is hidden because it contains spoiler information about the solution
help him
I both love and hate seeing an arrow function leading to a less than or equal to. It's like two arrows pointing to the same variable.
New to ruby, is that forbidden? Weird that it makes the random tests fail but not the others.
Ruby version is working correctly. And you're most probably mutating the input.
Ruby random tests verification uses the same value for target and start. But the function is fed different values (Same issue reported by @sergeyn 3 years ago).
Rand test 1
start = [7, 7]
target = [0, 5]
wrong route from [0, 5] to [0, 5] - Expected: [[0, 5]], instead got: [[7, 7], [6, 6], [5, 5], [4, 5], [3, 5], [2, 5], [1, 5], [0, 5]]
I wrote this solution. I can tell you it breaks two tenets of javascript best practices of old: (1) avoid the comma operator and (2) always delimit blocks with curly braces. Whether these are still as relevant now as they were then is debatable.
I've always held that the comma operator has its place in loop conditions. You should get acquainted with it. But in this case it's the wrong tool for the job. I've virtually never used it before, but I think this is a case for the
do ... while
loop.Is this while loop really "Best Practices"? Made me scratch my head for a while.
Thanks that worked! It seems my solution was just a little bit too slow with 10 long string random tests total.
What's weird is that I now see many solutions using array methods. I tried the first two higest rated ones and they time out too.
I guess the server was a bit slower today.
Try using for loops instead of split + foreach. There are better ways of doing it too, but that should work.
This comment is hidden because it contains spoiler information about the solution
There are many different kinds of parser problems, and this one is not those ones worthy of being a blue kata. This one doesn't even have precedence rules, and yes, even a slightly complicated regex will work very fine.
Elephant in the room: there are many possible difficulties to a parser, which all depends on the grammar. Not anything marked "parser" is automatically "very hard". Please put up some better arguments next time before asking me why I downranked some particular katas ;-) I expected better from all of you.
Yes (if anyone can plug in a parser combinator library and finish all of them with just the slightest variations required, they're not very good katas), but irrelevant to this kata. I downranked it because it really isn't hard.
Resolving because OP is basically saying the old "everything I can't solve is
1kyu
, can you re-ranking it to such?", which is not a good judgement on the kata rank.the funny thing is that upranking isn't possible either...
@FArekkusu :
You should probably ask Voile for the reasons and not me. Though the Kata was a lil over ranked anyway. 4Kyu would have been better (after random tests)
, Well no more down-ranking is possible now, so :(
You could always ask admins to do it. :)
Loading more items...