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
Can someone explain?
Thats cheating man xd
This comment is hidden because it contains spoiler information about the solution
sum
splice
may seem attractive, but it's generally slow; try avoiding itIt's not as performant as it could be, but it has more or less the right asymptotic performance. It's not as maintainable as it could be ( and this is bigger than you possibly think ), but .. it works.
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
Can you review my JavaScript solution?
https://www.codewars.com/kata/reviews/58e781d2c731c115d9000e01/groups/61e2e39054e22a00012dde53