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 is so cool.
What about joining with gibberish characters?
Nice simple for loop. Less debatable than my reduce function.
Why? You are reducing to a single number according to the data ops. The only time there is no operation on that number is for operation
o
, which just pushes the number to the main function's output array. Seems pretty straightforward.I've done it a bit differently in that my reduce function builds the main output array but I like this top solution, focusing on the number itself.
This comment is hidden because it contains spoiler information about the solution
Make sure to run a Minifier on this code to decrease the amount of characters. It will be more readable.
I think it's over-documented. To me it's simpler to make the code shorter (reasonably), thus more readable by itself.
Looping does not need to go through the end. It can stop much sooner if both even/odd arrays have at least 3 values, and each of them has at least 1 value.
Instructions say that the arrays can be huge. Which means we probably should worry about it.
A proper, performant solution is still readable for this problem.
This comment is hidden because it contains spoiler information about the solution
You could do
return divisibleX && divisibleY
only, itll return true if true and false otherwise by itselfThis comment is hidden because it contains spoiler information about the solution
The starting string must absolutely not be > 139 characters. 139 chars will allow you to add an hashtag if the provided string is 139 actual (eg no stripped spaces) chars