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 sort in the couter chain on line 2 is totally unnecessary since the reduce returns an object. However nearly 30 people came up with this exact solution.
@Firefly2002
I'm here to write exactly the same comment except now its 6 + "20 more warriors".
With a relatively complex problem like this, if you ask 1,000 people to code it, I would expect 1,000 distinct answers.
This comment is hidden because it contains spoiler information about the solution
12 people all with the same answer.. yeah, no not suspicious at all.
This comment is hidden because it contains spoiler information about the solution
I apologize. This is not true, although I do not know why it wouldn't be. For some reason Array(count).map(_=>key) doesn't work as expected, or as I expect it to : )
Awesome solution - about one-hundredth the size of mine. One question: why was [...Array(count)].map..... used and not simply Array(count).map.....? It seems to me you arrive at the same result..