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.
no it works for all kinds of words. the reason it works is calling split(' ') on strings with double or arbitrarily spaced characters produced empty strings in the return value, and when you call .join() all the empty strings are joined back with spaces between them. the empty strings from splitting multi-spaced strings act as placeholders for when the string is re-formed so the spacing is preserved
Wow, what a solution! I love one liners and it looks clean!
Clear and concise! I love it. Much cleaner than my own.
This comment is hidden because it contains spoiler information about the solution
Very simple and clean. Easily the best practice and I learned a lot from this.
This is a great solution for double and single spaces! But for anything more you'll need to utilize RegEx
This comment has been deleted.