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.
They work fine, your problem is somewhere else.
You have to put it like string.Join(''), as in some other methods you have to write System.X instead of X. Annoying and common on codewars.
For JS I think there's 500 random tests. With basic approach I'm passing in ~1.5s. You can always add console.log(n) at top of your function.
Either you got an infinite loop, or your code is really slow. Whatever the case, that's not a kata issue.
String
is not anArray
in JavaScript, they're entirely different datatypes.You've to return an array, and you're not doing that.