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

    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

    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.