Ad
  • Default User Avatar

    (Never mind I read the description again)

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

  • 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!

  • 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?

  • 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

  • Custom User Avatar

    what language are you talking about?