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.
This honestly should be clarified in the instructions. It's been asked about multiple times in the discussion and threw me off when I read over the instructions too.
It's described in the docs at http://ruby-doc.org/core-2.2.3/String.html#method-i-gsub.
Maybe it's becuase I'm tired, but I don't understand how this function returns
nil
for the matrix[[1,2,3], [4,5,6]]
.In the first run, we get
cen = [4,5,6]
(2/2 = 1
), which is an array, and so the program proceeds to recursively callcenter
, now with the argument[4,5,6]
. This time, we getcen = 5
(since(3/2 = 1)
). This is not an array, and so thecen if mat.size.odd?
statement executes. The size of[4,5,6]
is 3, which is an odd number. So I don't understand how this returnsnil
. Someone please explain :)