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.
Adds random tests.
I like this. One minor tweak here would be to start
Range
at1
instead of0
since0
will never contribute to a sum, but that just saves you one iteration.this really clever i loved it
'filter' creates a new array + iterates through the total array.
the 'reduce' solution stops when needed and returns a boolean.
I had the same problem. The tests feed back the output from your encode method to your decode method. So take a look at your encode method, especially the usage of javascript bitwise operations if you have them, like people have discussed below.
This solution is very elegant! It's so easily readable
Same problem here
This comment is hidden because it contains spoiler information about the solution
If the reference returned by
report()
is supposed to match the current values, not a snapshot, then the description needs to say this. Ideally with an example, e.g.At first I thought report() method should return an immutable object. One whose totalCalls and log doesn't change after spied is called again after calling report(). I understood it as a "snapshot" from the time it is created (compare printed report).