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 agree it's concise, but I don't get why people vote this as best practice.
would and should;-)... l and r are global values, so should be never best practice...
This would fail if there were any characters other than "?" or "!" in the string. And double equals should never be best practice.
This comment is hidden because it contains spoiler information about the solution
Thanks;-)!
very nice
thanks for the info myjinxin2015.
Thanks;-)... haven't seen the question...
[...string] equals to string.split("")
the 0 at the end of reduce means initialValue. If you omit it, the function will choose the first element as the initialvalue, i.e left[0], right[0]