Your gsub! modified the input. If you want to make a copy of input string, please use s = x + ""
The result of your solution is wrong. It can not handle the testcase like this: Test.assert_equals(zero_and_one("110100"),2).
This is what happened when I used x and y as my variables. It's not the truth. I guess that you want to do some test but not changed all the name s to x(or y).
I think int(l**.5) is explicit enough, floor confuses more then it helps imo
True, but it's more explicit that way.
fixed
Your
gsub!
modified the input. If you want to make a copy of input string, please uses = x + ""
The result of your solution is wrong. It can not handle the testcase like this:
Test.assert_equals(zero_and_one("110100"),2)
.This is what happened when I used x and y as my variables.
It's not the truth. I guess that you want to do some test but not changed all the names
tox
(ory
).Please try again O_o
Fixed.
Ok, try it now.
Ha, that was something stupid on my part, fixing it now.
.
Try it now.
Looks to be fixed in Ruby.
Fixed.
This comment is hidden because it contains spoiler information about the solution
Fixed (I hope).
This comment is hidden because it contains spoiler information about the solution
Loading more items...