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.
Should you escape the regular expression?
This is awesome!
So, if n is not nil, it is truthy. Hmm.. I like this.
seconded
The kata could be more specific as to what kind of array it accepts as input. Is it a two-dimensional array? In the details, it seems so, but in the given test case, one-dimensional array is shown. This makes solutions vary.
One might also ask if it can be an array of any length.
The output of the test case does not display Date object properly, but just display them as
#
. It is hard to see what value is being returned, and one has to resort to irb.I think this solution is the easiest to read and understand.
This is similar to my approach. Could anyone explain the role of the semicolon
;
in the block following the.inject
? I am having difficulty understanding this one liner.Brilliant! But this regex does not detect words ending with "'". e.g. "Louis'"
The default value is being used. For instance, when
number
is 37,rules[number % 10]
isrules[7]
. Sincerules
hash does not have the key7
, default valueth
is returned.This comment is hidden because it contains spoiler information about the solution
Seconded. The spec uses ranges but the question seems to imply that the input is an array.
Why did you use
=+
and+=
? Are they different?I like this one. Very clever.
It took me two days and finally I got it now! I hated this kata at first, but now I like it.
Loading more items...