Ad
  • Custom User Avatar

    other types of solutions

    There are only 2 types of solution, which both presents in that kata. Input being numbers allow more specific operations, but this is a trick more than an actual difference.

  • Custom User Avatar

    Keep in mind that every integer contains 0, since 0 technically has no digits.

    This is not properly tested: the only relevant test is contains(100, 0), which already contains 0.

  • Custom User Avatar

    The solution from that kata passes this kata. But since this is with numbers only, other types of solutions also pass here. Tough one to call, but I would second that this is a duplicate.

  • Custom User Avatar

    This kata does not look different from https://www.codewars.com/kata/59daf400beec9780a9000045 besides the input being represented as numbers.

  • Default User Avatar

    (Never mind I read the description again)

    I am not sure:-) This example is explained in the description.

  • Default User Avatar

    Wait, but aren't 101 and 107 primes in the range [100, 110] with a prime gap of 6? That should be correct, right? I looked through the directions and saw that [101, 107] doesn't violate the rules. (Never mind I read the description again)

  • Default User Avatar

    In your code, before returning your array, print it to see what happens. Instead of returning "null" your code returns [101, 107] which is wrong (I tried your solution with a correct printing of the returned array); you should read carefully the complete description.

    J@2eydhe74 or garbage like that

    It's not garbage; it's the way that Java prints array...
    If you don't know how to print array as a string google "java print array". Good luck!

  • Default User Avatar

    Yes this happens every time it checks for null, including the sample tests.

  • Custom User Avatar

    @realJarJarBinks

    Does returning null for the (6,100,110) test case cause that problem for you as well?

  • Custom User Avatar

    I flagged your code as spoiler and indeed I was too quick to do this, but I did not do this because it was code. I was convinced that this kata is missing random tests in Java (I remembered this wrong), and I thought that your example simply solves the kata by counting the test cases. It's not the case here, so I un-flagged the comment.

    However I think I am still missing something, because I do not see how this example helps and how it addresses OPs question. It passes sample tests, true. But what exactly does it prove about the full test suite?

  • Default User Avatar

    Is it a problem with my computer? When I return null, it returns something like J@2eydhe74 or garbage like that and marks it as incorrect.

  • Custom User Avatar

    How is a hardcoded example of the tests behaving correctly a spoiler? I'm unsure why that was flagged, and I think it was a useful addition to a spoiler-free discussion. It seems like someone saw code and assumed it was a spoiler without even reading the code.

  • Custom User Avatar

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

  • Default User Avatar

    I am using Java.

  • Custom User Avatar

    what language are you talking about?

  • Loading more items...