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.
very nice
I don't know what was on my mind when I wrote that. Looking at it now, this seems like a perfectly sensible and straightforward solution to me. I happen to like yours better because it doesn't pollute the function signature.
And how is map() better than replace() here? map() is made for arrays, replace() - specifically for strings. replace() is a perfect fit for such a task.
cool solution)
Probably mean the Math.max()
what are you talking about the second iteration?
I'd say that if you don't care about a specific separator, then you can go for the spread operator.
No, this is :)))
That's not the worst. It's never better than
O(n log n)
. In the best case,O(3)
can be achieved.And I thought I had some unorthodox solution
That's a really good point. I hadn't noticed that. Although there should be a test to check that the result is the same array instance.
fair enough, but for a problem like that it feels like OOP just adds overhead for no practical gain, since the kata just asks for a return value, not a modelization
im not a good programmer but that's what it feelks like for me
your solution looks cool tho i'll admit
What custom data structure would you add?
Why do I so rarely see a neatly organized object-oriented solution? Always procedural, procedural, procedural, and never a custom data structure in the mix. Makes me sad.
I think what OP means is reusing input values, not necessarily "mutating" them.
Loading more items...