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 also thought that would be cool to solve this using regex!
In my case I used
join('')
enstead ofjoin('-')
and solved the /222/ problem by checking how many numbers are behind like this/^(...)*2{3}
You can see full code here:
https://www.codewars.com/kata/reviews/525caa5c1bf619d28c000338/groups/61e41f559a04f80001a6b80a
You have a most interesting flaw in your reinvention of
Test.assertDeepEquals
.Also, what everybody already said + no random tests.
Needs serious change and improvement, or unpublishing.
Duplicate of this one: https://www.codewars.com/kata/merge-two-sorted-arrays-into-one
You should:
Cheers
EDIT: actually, could rather be a duplicate of this one or something like that...
If you want people to write some code about algorithms, please improve your testcase to prevent brute force solutions. ;-)
And, example testcase missed.
So
join('-')
stops /222/ from solving your example as it add an extra character at the end of each row.This comment is hidden because it contains spoiler information about the solution