Could you expand on why you think an algorithm doesn't need to travel the entire array? I thought it would have to move through the entirety of the array to determine which numbers are odd/even.
Or is it that due to the limitations of the problem just as long as there is more odds than evens and vice versa, it won't have to travel through the entire array?
The tests are not working, they give back this error: ': undefined method length' for 3:Fixnum (NoMethodError). When I changed the length method for something else, like the count method it spat this out instead ': undefined method count' for 3:Fixnum (NoMethodError), so it seems to me there is some tests that are not functioning. I cannot do anything about it because I cannot pass it. My code works perfectly with the test cases - and others - on my own computer.
I'm not 100% sure but there seems to be a mistake. I get this error: Expected: "JKD WBIRAQKF YE WV", instead got: "JKD WBIRAQKF YE WV". How can the expected be the same as the input?? Doesn't this mean the code passed the test??
This is the issue I'm having: square_digits': undefined method digits' for 3212:Fixnum (NoMethodError)
from `
'
The code I have runs fine on my computer, but not with this. I'm wondering if there's an issue with the version number as Integer#Digits came with the lastest verion of ruby.
Could you expand on why you think an algorithm doesn't need to travel the entire array? I thought it would have to move through the entirety of the array to determine which numbers are odd/even.
Or is it that due to the limitations of the problem just as long as there is more odds than evens and vice versa, it won't have to travel through the entire array?
How do you figure out that it takes 3N? I don't know how to do this so I'm curious to learn.
Elegant solution!
This comment is hidden because it contains spoiler information about the solution
The tests are not working, they give back this error:
': undefined method
length' for 3:Fixnum (NoMethodError). When I changed the length method for something else, like the count method it spat this out instead
': undefined methodcount' for 3:Fixnum (NoMethodError)
, so it seems to me there is some tests that are not functioning. I cannot do anything about it because I cannot pass it. My code works perfectly with the test cases - and others - on my own computer.I had this exact same problem! I hope it gets fixed soon.
I'm not 100% sure but there seems to be a mistake. I get this error:
Expected: "JKD WBIRAQKF YE WV", instead got: "JKD WBIRAQKF YE WV"
. How can the expected be the same as the input?? Doesn't this mean the code passed the test??This is the issue I'm having:
square_digits': undefined method
digits' for 3212:Fixnum (NoMethodError)from `
'
The code I have runs fine on my computer, but not with this. I'm wondering if there's an issue with the version number as Integer#Digits came with the lastest verion of ruby.