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.
This is reasonable -- maybe it's confusing if it's not a good application of streams. I've practicing using stream solutions, (even if there are other ways of doing something) so I was pleased to see this here.
I tend to disagree, this way of doing thing is similar to functional programming.
I woulad have added a map step for the replace call.
ALready said but of course a joining is better than this reduce combined with the get call.
If you absolutely want to a use a reduce, maybe you can use the other version with a initializer
".reduce("", ...)
I see now that actually entrySet could have been called on the map itself -- allowing it to keep chaining using sorted() and limit 3
I would have liked more clarification on ' not counting as a word (as suggested by the test case)
The assumptions mention "A word is a string of letters (A to Z) optionally containing one or more apostrophes (') in ASCII."
So it seems like "'" would be a valid word -- the string of letters is the empty string, and optionally contains an apostrophe
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
If you want to use Streams, you can simply precompute the equal element, then filter them all out. This is what I came up with.
This comment is hidden because it contains spoiler information about the solution
+1 for no one wants to deal with that regex. But I imagine plenty of people wondered how it would be done.