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.
The last argument in reduce is intentional - I like to isolate the scope and try to to operate with the things that are not in the scope. Just a general rule.
And we both didnt consider that would happen if first function call would be on a single value, not an array.
like
difference(5)
should probably return 5, same asdifference([5])
.Function should not break.
But yeah, I agree, there is a room for improvement. Thanks.
You are right - there is no need to using spread syntax in this case.
It is just a habit (to create new arrays or object with optional keys without mutations).
Regarding all the logic in params - this is the dirty way to create variables.
Thank you.
This comment is hidden because it contains spoiler information about the solution
Will not work for string where every char has only one occurance.
longestRepetition("ab")
will return ['', 0], while it should return['a', 1]
.There are no test cases for that, also.
Nodejs tests sorts the string wrong. On a reply below you can confirmed that yourself.
What do you mean that it is not an issue and code is not following specs?
It works in chrome. Probably on latest node as well.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Well, I guess I will try to mark every comment to my solution as a spoiler.
But still - post is attached to solution, solution is attached to kata - there is no reason why post visibilty should bypass solution visiblity. What was the case?
Like I commented any solution - and expect that ppl who never solved the kata will answer? This is so messed up. Cant even think of any case why would they implement it this way.
Strange.
Why the comment to my solution should be visible to ppl who haven't completed the kata?
Like it is a comment to solution - it should have the same visibilty as a solution.
This comment is hidden because it contains spoiler information about the solution
Omg, this is such a mess.
Since it is time, we should use Math.abs - this way we do not rely on arguments order.
The idea was to replace .filter().join() with one .reduce().
Loading more items...