Ad
  • Default User Avatar

    You can print the input with e.g. System.out.printf() to see which cases you are failing. Your code is incorrect because it does not handle e.g. "2 glasses of wine and 1 shot" (you split on commas, but there is no comma there).

    Very unclear, what the input would be

    the description states:

    To keep the things simple, we'll consider that any "numbered thing" in the string is a drink

  • Custom User Avatar

    Please use appropriate markdown formatting when posting code. See https://docs.codewars.com/training/troubleshooting#post-discourse.

    What is wrong with my code? I checked it locally on my IDE, and it works as supposed.

    Your code does not meet the following requirement:

    If two words have the same last letter, they returned array should show them in the order they appeared in the given string.

    For example, for the input "man i need a taxi up to ubud", your code incorrectly outputs {"a", "need", "ubud", "taxi", "i", "man", "to", "up"} instead of {"a", "need", "ubud", "i", "taxi", "man", "to", "up"}.

  • Custom User Avatar

    Your code does pass both basic and random tests. However, this is not the proper way to raise an issue, and there is actually no issue unless you demonstrate it clearly. Please read carefully the documentation: https://docs.codewars.com/training/troubleshooting/