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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Ah, gotcha. Totally understand!
Might as well be :) Im just using codewars to get my arms dirty in the language, and this was one of the earlier answers :P Thanks for the advice though.
This comment is hidden because it contains spoiler information about the solution
You're right, thanks.
Probably more idomatic to write the first line as:
Fixed. Thanks for the feedback ;-)
For the Ruby version, the tests use the method
to_camelcase
though the default method has it set up asto_camel_case
.Seems to be working now. Great!
I think I'm running into the same issue as omegahm. For example, in the previous random test I passed with:
But in the following test (which had a max array size of 4), I get:
However, when I printed the input, there was never a 98:
FWIW it's in only the random tests this is happening.
You don't need the
return
on line 3 since the value of the last evaluated expression in a method is the return value of the methodFor "up" and "down" you can just set
x
to0
and1
respectively since there are only two rows (as opposed to using the ternary operator).