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.
You can use named result parameters to save one line ;-)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Wouldn't that depend on what your expected behavior on having a non-integer input is? Depending on context, returning without raising an exception could just create problems.
This comment is hidden because it contains spoiler information about the solution
Wouldn't this method fail if either a or b is nil ? I noticed that a lot of kata solutions don't take those cases into account. Whilt adding a simple guard clause:
return unless a && b
would cover this.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution