Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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...

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thank you! Learned somthing new :)
    It would be maybe helpful to tell in the kata description how many tests to pass.

  • Custom User Avatar

    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?

  • Custom User Avatar

    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?

  • Custom User Avatar

    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...

  • Custom User Avatar

    I've only done the regex yet and it gives me an error by testing and attemt:

    Time: 1021ms Exit Code: 1
    Test Results:
    Log
    No examples found.
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Okay, thx! I found a solution an regex101.com was very helpful!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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...

  • Custom User Avatar

    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...