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.
The ternary operator is redundant in this case
Hi Robin479,
Regarding your first observation you are right, there might be cases that a sentence starts with a space. As of your second observation there is no point writing code for every kind of possibility, I don't think that this is the purpose of this kata. If we wanted to deepen the problem we could write a compiler from scratch! Either way thank you for your comment.
Your loop starts on the third character. You're algorithm will fail on input like " this sentence has a leading space." You're code will also fail on input like "this sentence uses no‑break‑spaces instead of regular spaces."