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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Just a suggestion for next time to save on time and space:
Instead of splitting the message into an array, you can use a
for ... of
loop to cycle through the letters one at a time.The code would look as follows:
for (let c of message) {...
Following. would love to know as well
This comment is hidden because it contains spoiler information about the solution
Lol.. I spent longer than I'd like to admit trying to wrap my head around it as well :(
This comment is hidden because it contains spoiler information about the solution
@CodedVortex thank you for this explanation, I didn't know that using
Array
was not best practice.Barring when it is not used correctly, does the literal notation have any performance benefits over calling the constructor? (i.e. any time/space-related metrics.)
The /../ part of the code represents a Regular Expression (RegEx) that looks for any 2 types of characters. If the length is even, When it comes time to check for the last character (i.e. the underscore) it will not be able to find another character after it, and thus won't add it to the resulting array.
This comment is hidden because it contains spoiler information about the solution
For the test case of (20, 14), I get the following error:
Expected: [14, 6, 6, 2, 2, 2], instead got: [14, 9, 1, 1, 1]
Why is that? Both of them should be perfectly valid from what I'm seeing, and I don't see anything in the instructions that would suggest otherwise.
Stick with it, bro! We all start somewhere, and the road is never easy.
You can do this!!!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...