Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Ah, ok, I completely missed that. Thank you for pointing it out!
    IMO that line was easy to glance over, or misunderstand. I think I interpreted that they weren't even part of the kata at all.
    I think I made that misunderstanding because of a combination of:

    • only weighted letters are in the score table
    • only weighted letters are used in the sample tests
    • non-weighted letters only appear in the full-attempt tests, in the random test case. (It was easy for me to make the assumption that the random test case was buggy, and introducing characters it shouldn't)

    Do you think it would be a good idea to add a test cases with non-weighted letters to the sample test cases then? I think that would help people understand.
    Unless part of the fun is reading closely, and only finding out about the non-weighted once you do the actual attempt!

  • Custom User Avatar

    For the Java kata, the given sample test cases work fine because they only use the given left vs right side set of characters.

    The issue is: the random test cases generate random characters. I think this makes no sense since we don't know the weighted values of those characters. The given letters in the description are weighted in power, so we can't possibly know what to weight a random character. We also aren't told to just treat any other character as a default of one, or anything like that.

    So, I think this kata is broken for Java. You can't possibly pass the random tests which are using random characters in the fight.

    EDIT: Actually, after trying some stuff, I got it to work by not considering the values of random characters at all. Maybe that's something you should put in the description... I had to guess that other characters could be ignored, then try it out and see if it worked. I had no idea that's what I was supposed to do.

  • Custom User Avatar

    This solution that you've commented on correctly deals with starting and ending spaces. Try it out by forking the solution and adding a test case with leading and trailing whitespace.

  • Custom User Avatar

    Why add the {1}'s when they are already implicit for single characters? It clutters readability without adding benefit.

  • Custom User Avatar

    It's your job to return -1 if you detect that bounce == 1.0... The timeout is an expected failure if the instructions said it shouldn't be 1, right?

  • Custom User Avatar

    I encountered an issue during this kata: the kata itself was fine, there was nothing wrong with the logic of the kata itself. But when running my function, the last lines of my program would not run! This might be a bug in codewars and how it runs java. I have not had this problem for other kata.
    See my solution, I've commented the code which should have been able to run.
    My solution: https://www.codewars.com/kata/reviews/56a5deb87297212bec00001e/groups/57a27b0c53ba3327cc00012b

  • Custom User Avatar

    In Java, you'd want to test edge cases, such as -2147483648 and 2147483647 for the range of int. Although this might make your suggestion to do it in one line with no conditionals very difficult.

  • Custom User Avatar