your regex does not recognize words that start with an apostrophe as starting with the apostrophe
for instance "'aa 'aa aa" would become ["aa"] instead of ["'aa","aa"]
now is this ever relevant? I 'unno but it IS allowed by the definition given in the kata
Sometimes creating a list for the purpose of calling sum is marginally faster (especially if the list gets longer)
Hence I upvoted this answer along with a very similar one that uses map
That isn't an issue, but an opinion on the test suite / specifications.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
your regex does not recognize words that start with an apostrophe as starting with the apostrophe
for instance "'aa 'aa aa" would become ["aa"] instead of ["'aa","aa"]
now is this ever relevant? I 'unno but it IS allowed by the definition given in the kata
This comment is hidden because it contains spoiler information about the solution
you're right.
Yeah, of course. Totally forgot about it
Right. It is my "weak spot". Need to solve all katas under "Regular Expressions" category.
Maybe... I spend some time for getting complete understanding of your solution. )
I hope people judges what code is easier to understand...
Yeah, you are right. It was one-step solution without any refactoring at all. Your solution is better.
Definitely. That would read much better. Thanks!
I thought that inside functions you didn't need spaces around operators?