Ad
  • Custom User Avatar

    Added to all languages

  • Custom User Avatar

    I have added some more random test cases. Solutions that ignore the order will not pass anymore. Some of the more "clever" solutions are also invalid. However, it seems like updating the test cases will not invalidate those solutions. (Or maybe it just takes some time.)

    If you would like to try again and see if the test cases feel better now, I would be very thankful.

    Thanks again for pinging me on this. :-)

  • Default User Avatar

    Closing issue.

  • Default User Avatar

    Closing issue.

  • Custom User Avatar

    It has been impossible for me to add more test cases after the kata was published, but it seems to have changed. I'll get on it shortly.

    Thanks for making me check again! :-)

  • Default User Avatar

    Can we add some more test cases for Java to stop some of the solutions that have gone through as correct but don't meet the description?

    Some examples:
    assertTrue(StringMerger.isMerge("abac", "ab", "ac"));
    assertTrue(StringMerger.isMerge("abac", "ac", "ab"));
    assertFalse(StringMerger.isMerge("abcad", "acd", "ab"));
    assertFalse(StringMerger.isMerge("abcad", "ab", "acd"));
    assertFalse(StringMerger.isMerge("abc", "ac", "a"));

  • Default User Avatar

    Can we add a test case to stop this incorrectly being marked as correct?

  • Default User Avatar

    Your suggested unit test does return 0 when I run it against my solution. What is the issue here?

  • Default User Avatar

    Hi

    I'm a bit confused by your issue. Are you saying that you wrote a solution that passed all the test cases but it also returned 0 for 11123455567890 and 12345567890?

  • Custom User Avatar

    This is the issue I'm having: square_digits': undefined method digits' for 3212:Fixnum (NoMethodError)
    from `
    '

    The code I have runs fine on my computer, but not with this. I'm wondering if there's an issue with the version number as Integer#Digits came with the lastest verion of ruby.

  • Default User Avatar

    You should assume that the compiler will execute your commands as you give them. Even if you wanted the compiler to handle that, it has no way to recognise that the first multiplication on the second line is the inverse of the function call on the first, especially when you've got a cast in between the two statements.

    The extra work done on the second line also makes it hard to read.

  • Custom User Avatar
    1. You need to return the output instead of printing it to the console
    2. You need to close your function by adding a closed-end curly brace, "}"
    3. You can remove the manual function call since the testcase will automatically call of the function for you, in order to check for equality
  • Default User Avatar

    This needs a unit test that has a 0 in it, my code choked on that the first time because I got a number with a 0 in the random test.

  • Default User Avatar

    This needs a unit test to ensure that the code doesn't give a false positive when the double in the second number isn't of the same digit as the triple in the first number. For example, 1112345 122345 should return 0.

  • Default User Avatar

    When I first tried this I came up with a solution that would return 0 for the numbers 11123455567890 and 12345567890, but succeeded for the tests given. Could this be added as a unit test?