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.
Why not just return everything on the right side of the || operator? I don't understand what the comparison to !str gets you. Halp please.
This comment is hidden because it contains spoiler information about the solution
wah wah awesome!
Nice use of join. I wasn't aware it would flatten an array and return values so well.
I agree. All 'indexOf' type functions search the whole array for the supplied element and return the index it's currently in, like a for loop. Since you already go through numbers the size of the array (O(n)) and for each one you do the same with indexOf, you get O(n^2). The reduce solution, however, goes through the array only once, therefore being a O(n) solution.