This comment is hidden because it contains spoiler information about the solution
Ah, gotcha. Totally understand!
Probably more idomatic to write the first line as:
return false if string[position] == nil || position < 0
For the Ruby version, the tests use the method to_camelcase though the default method has it set up as to_camel_case.
to_camelcase
to_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:
Test Passed: Value == [98, 97, 94, 53, 46, 36]
But in the following test (which had a max array size of 4), I get:
Expected: [98, 97, 97, 95], instead got: [97, 95, 87, 83]
However, when I printed the input, there was never a 98:
4, 77, 75, 70, 67, 87, 97, 83, 95
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 method
return
For "up" and "down" you can just set x to 0 and 1 respectively since there are only two rows (as opposed to using the ternary operator).
x
0
1
Loading collection data...
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!
This comment is hidden because it contains spoiler information about the solution
Probably more idomatic to write the first line as:
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).