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.
I liked the "str::to_string" part.
Clever!
But this solution does not account for negative values... 🤔
This shouldn't have worked, '\s' matches any whitespace character rather than just ' '
This comment is hidden because it contains spoiler information about the solution
Can you please explain the difference? I search it but I don't find anything
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It does, doing
' '.join
will return its original whitespaces (separator of the values).str.split
separates the substring into values inside a list. i.e:It'd be different if you leave the args as default tho
but wouldn't it join all the spaces together with an added space?
I'm a bit confused. Doesn't split(" ") take away spaces?
Because the solution is using
' '.join
I'm confused. How does this copy over the extra spaces? When you use split(" ") doesn't it mess up all of the spacing?
yes
you can use a list.
Same
Loading more items...