Ad
  • Default User Avatar

    The idea is that no number from the interval (n/2, n) will ever be a divisor of n.

  • Custom User Avatar

    hi, can you please explain to me why i <= n/2; i somehow get that this is faster than going through every i until it reaches n. but i still don't grasp the idea.

  • Default User Avatar

    the sample test that i can see is:

    Assert::That(doubles("vvvvvoiiiiin"),Equals("voin"));  
    

    there are 5 is there, so the last one stays. You may have inadvertently modified the sample tests. I'm closing as this does not seem to be a kata issue, but feel free to come back if you have more information

  • Custom User Avatar

    in the C++ the result should be "von" not voin , or the string that is feed to the function should have an extra i.
    Assert::That(doubles("vvvvvoiiiin"),Equals("voin"));

  • Custom User Avatar

    Your solution is prone to problems with accuracy of floating point numbers:

    Here's what I found:

    The issue with your solution lies in the way you check if the side is the cube root of the volume. Using cbrt(volume) for integers can result in precision errors since the cube root of an integer might not be exactly an integer due to floating-point arithmetic inaccuracies.

    Your solution is buggy, it's not a kata issue.

  • Custom User Avatar

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