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.
This comment is hidden because it contains spoiler information about the solution
Just what I wanted to notice, this regex doesn't cover all the words.
gj nia-h!
The point of the "replace" method is changing the original string. He returns new string. But in this solution it is used to create an array of words and totaly ignore the essence of method and returned value. It's not a trivial case like using your phone to hammer nails.
To create an array of words it's better to use method "split" or "match" on string or go throgh string with any other loop (for, while, do-while). In Birhanu's solution you can see how it's work with "split" and how it works with "for" loop in mine.
what do you mean " ist better to use iteration", I'm a new Javascript learner and I know what iteration is, however I cant imagining code with iteration, can you show me a little simple? ヾ(^▽^*)))
alexshavlovsky.........
dang what a nice answer bro
really hard for my brain to chew tho hahaha
Can someone explain me this code ?
The replace method is used improperly hence its a bad practice to use methods beyond that its tend to do. ist better to use iteration if the iteration is only needed to construct the Map object.
Why is it so fast?
it is possible, but the tests will not pass in all cases and not for all data. And since the data is generated dynamically, the complexity of sorting varies, as well as the correctness of the final sample.
dict.delete("'") covers single apostrophe..
I reckon it would fail with input " '' "
This comment is hidden because it contains spoiler information about the solution
Am I wrong or does this not match words ending with a .(fullstop) or ,(comma)?
The short answer is, It's a Positive Lookahead (zero-width assertion). look ahead for 'space' (or end of $tring) without including it in the result. Good Job on this kata.
What about mine? It's the replaceAll complementary
Long live to regex assertions
Maybe you want to add this to the description or does it 'spoil' too much?
Loading more items...