Ad
  • Custom User Avatar

    Many Thanks. I tried returning an empty array earlier, but i might have done a mistake. Now it works. Also thanks for the markdown link :)

  • Default User Avatar

    If the input array is empty or null, return an empty array.

    In this case, you're returning input (which is null). Instead, you should be returning an empty array. The problem in on line 7.

    By the way, relevant link: markdown formatting

  • Custom User Avatar

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

  • Custom User Avatar

    I have to say i am a bit lost here. I try the kata in Java. After some research i found out that there is something called default method. But i still don't know how i should actually start to code it or even how i should use the default in the first place.
    Maybe some explanation about the method and how it works might be a good idea?
    If you didn't guess. I am pretty much a total beginner.

  • Custom User Avatar

    Thanks, this did the trickt! :)

  • Custom User Avatar

    Just one problem, that solves it all.

    a[i] == l[0]

    a[i] == l[j]

    In Java, you don't compare strings like that. Use a[i].equals(l[0]) instead. Not sure why it passes the example tests.

  • Custom User Avatar

    That is exactly the problem. That (i think) my solutions are correct, but the random test always failes.

  • Custom User Avatar

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

  • Custom User Avatar

    Actually, I see you solved the kata. Hope you enjoyed it! :)

  • Custom User Avatar

    This isn't an issue, as there are 86 Java solves.

    expected:<[z]> but was:<[a]>

    I just ran a correct reference solution against that input, and the result definitely should be z.
    Please post your code here and mark the post as having spoiler content so we can help. Cheers.

    Also, I'll give you a hint in case this has to do with the problem: for fixing the overflow, try using the modulo operator.

  • Custom User Avatar

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