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.
Your function doesn't return the correct result. It adds an extra space at the end.
Even if you fix that, your solution also does not handle words with double spaces correctly either (as in the 4th sample test).
You checked it wrong:
You need to tell us what language you tried, and show us your code. Otherwise, we do not know what to fix.