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
Thank you! Yes that was the problem and solved by duplicating the original array.
But actually I don't realy get why that is a problem?
This comment is hidden because it contains spoiler information about the solution
For me its a realy clever solution but not a best practice. Readability could be better, style: empty line after guard clause?, and no need for attr_reader...
But don't get me wrong it's still a absolute nice and clever solution in my opinion...
This comment is hidden because it contains spoiler information about the solution
Thank you! Learned somthing new :)
It would be maybe helpful to tell in the kata description how many tests to pass.
I dont get it, it seems that I pass all tests and than it times out...
Example tests, Random tests with Small numbers (50 of 50 Assertions) and Large numbers (18 of 18 Assertions)...
Are theire more test, do I realy have to improve the given code?
I pass all sample test and get on all random test the following error:
./spec/solution_spec.rb:14:in `block in expected_twin_prime': uninitialized constant Prime (NameError)
Is their somthing wrong with the tests? I checked the output of my code for the provided test numbers and it seems to be correct. Or do I miss smth?
okay, I simply had to use the method too (I checked my regex in it) and than it works. The instruction reads like it would be possible to do only the regex but that didn't work...
I've only done the regex yet and it gives me an error by testing and attemt:
This comment is hidden because it contains spoiler information about the solution
Okay, thx! I found a solution an regex101.com was very helpful!
This comment is hidden because it contains spoiler information about the solution
okay, I can answer my question by myself. 00004 isn't a integer by definition that means possible values are between 10000..99999.
And my nearly right solution was passed out because it didn't stop immediately having found the solution what is a problem with a realy large input string...
Many people seem not to round the given values before calculating the arithmetic value (like I do in my solution). Shoudn't that produce wrong results by given hashes like {'A'=>40.336, 'B'=>25.789, 'C'=>10.0005897, 'D'=>153.424559, 'E'=>58.997} ? In my code there is a diffrence at the result of 'D' if I coment out the first line...
Loading more items...