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.
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.
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?
because the input is
209917
, not29917
It means dividing by 2 evenly. The "before we reach an odd number" gives it away. I should use the word "evenly" in description so it's more clear.
That's not tested for ( as many other things are not tested for ).
There is a solution for that, but it's outside the scope of a legacy 8 kyu kata with limited testing.
If MDN says it is then sure I stand corrected. Operators in the traditional sense operates computations on values. I'd call them seperators instead, which both makes more intuitive sense and doesn't dilute the meaning of operators.
Comma operator
Loading more items...