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.
you don't have nothing to do, this is look like a syndrome.
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
interesting
Writing everything in one line is a bad practice. It's just bragging about its tricky hardcore solution. It's too bad that many people called this solution "best practice" and "clever". This is a bad practice. And the solution is not smart, but abstruse and overcomplicated.
The solution from fortlasagna is much better. He generally does the same thing. But his code is much better structured and much better readable. Here he really shows the best practice.
mine is better
I missed the "All spaces in the string should be retained" part!
Other than that I got it! Wohoo!
That's clever for sure!
wow😂😍
This comment is hidden because it contains spoiler information about the solution
nice one bro (:
Great!
This is a great solution for double and single spaces! But for anything more you'll need to utilize RegEx
This comment is hidden because it contains spoiler information about the solution
That is some tight memory management.
no way bruh
Loading more items...