Ad
  • Custom User Avatar

    Congratz, and next time, please take the advice at the second post, I'm tired now ;)

    Just to make it clearer, I renamed the test in Sample test to sampleTests.

  • Custom User Avatar

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

  • Custom User Avatar

    Properly solve the kata or forfeit it, see the testing suite, realize the basicTests in the sample tests are one thing and the basicTests on Attempt are different (already told you this). I feel like talking to a wall here, seriously.

  • Custom User Avatar

    Those 3 are the sample tests and always worked with your code with the import. When you click attempt, there are more tests than only those 3 in the basicTests, that's why I told you to print the input.

  • Custom User Avatar

    No, because it's a problem with your code, not with the kata:

    Java Completions 6223

    The basic tests that don't work here, won't work in your IDE either (because your code can't handle them), maybe you're confusing the logs or something.

  • Custom User Avatar

    No idea, as I said, once I modified your code to handle cases < 3 it worked for me. Why don't you do that and paste your current code?

    P.D.: in basic tests there are tests with n < 3 too. And there is no test with n == 3 there.

  • Custom User Avatar

    Please, read the description again:

    n will always be a non-negative number; if n == 0, then return an empty array (except in C return NULL) and be ready for anything else which is not clearly specified ;)

    And print the input if you don't believe me. N is any integer equal or above 0, the instructions say this clearly, your code is wrong (here or in your IDE for n < 3).

  • Custom User Avatar

    I've copied and pasted your code and it only worked after handling the cases I told you, have you tried your code with those values? You used recursion and if n is less than 3 your recursion never ends (that's the stack overflow error about). It's not a problem of environment, it's a problem with your code's logic.

  • Custom User Avatar

    if n == 0, then return an empty array (except in C return NULL) and be ready for anything else which is not clearly specified ;)

    Your code is not handling that right, and there is another problem too, test your code with values of n < 3.

  • Custom User Avatar

    Not a kata issue, your code is missing some import. Next time mark your post as having spoiler content please.