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.
Doesn not work correctly for numbers over 18 digits.
Example
This comment is hidden because it contains spoiler information about the solution
This is nice except that every single one of 4
if
s will be tested even though at most 1 can be truthy.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.
that should be ilegal LMAO
Using reduce as a quasi loop without even returning any reduced value is kind of ugly to my taste.
Insightful! 🏆
good
This comment is hidden because it contains spoiler information about the solution