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'm confused by your question, hksong. My solution does indeed handle '(hello)' properly:
What are you seeing that I am not?
What was the point of even bringing it up when your solution would fail as well?
Note that reducers are supposed to be pure--they are not allowed to modify
r
or its contents, so you should be returning new objects every time you modify them.It does what is asked, so it's fine by me at least.
This solution will fail if there's anything other than a brace-y kind of thing in between the parens (e.g.
"(hello)"
), so it's not very realistic.See the follow-up submission for a more efficient solution.