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.
It shouldn't be possible to require
active_support
in my opinion. It's not in the standard library.Indeed doing it in-place causes the tests to fail for me.
The description should really mention this.
In ruby,
nil
is considered falsey in a boolean context.The expression
nil || 0
behaves likefalse || 0
.Since The
||
operator "short-circuits", if @size has a value other thanfalse
ornil
, it will stop evaluating the expression and return @size. But if it'snil
orfalse
, it will continue evaluating it and return0
.I hope that makes sense!
This comment is hidden because it contains spoiler information about the solution
The "Random Tests" section doesn't work correctly for Ruby.
It adds the positive values from
env
but doesn't subtract the negative ones.My solution passes all the Basic Tests.
This comment is hidden because it contains spoiler information about the solution
Note: this only works because of a lack of test coverage
"abe" is greater than "abcd", but also shorter.