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.
Make sure that there is a whitespace. It's "' '{3}" not "{3}". :)
doesnt work for me :/
3 spaces you could use " {3}" instead~
This comment is hidden because it contains spoiler information about the solution
it checks whether there are more than one whitespace and splits
Great solution, using Streams as other solutions I think is overkill for this kata.
I suggest changing the type of result from String to StringBuilder to make it faster and less memory hungry for big Strings.
StringBuffer is way slower than StringBuilder, because it is synchronized. And if nowadays you see StringBuffer anywhere in single threaded code it is archaic (or poorly written) code.
BTW code from kata with +="" whould compile to StringBuilder concentrations, very inefficient ones however.
first ,U should add this code:
morseCode.isEmpty() return "";
second ,
StringBuffer result
result.append()
how this works? word.split("\s+")?
Finally the same solution I found is the top one! All of the other problems I solved had solutions by other people that were way better, lol. I did go with the StringBuilder as others have mentioned but the difference is kind of trivial. That would just be an efficiency upgraded needed when dealing with larger datasets.
StringBuilder is more efficient.
spoiler flags!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...