Ad
  • Default User Avatar

    There is no test case for v1 == v2, which is a condition that the instructions specify should result in 'nil'. Many of the accepted answers do not meet this requirement and cannot handle this input at all.

  • Default User Avatar

    The author failed to provide a test for it, but this does not correctly return nil if v1 == v2, and instead results in an error.

  • Default User Avatar

    This causes an error if v1 == v2

  • Default User Avatar

    Can you provide one clever example of how the task at hand or its solution would change if a different system were used?

  • Default User Avatar

    Thank you -- that was exactly the problem.

  • Default User Avatar

    Shouldn't a combination in which every A bonds to a T and every G bonds to a C return true?

    Testing for ACATTAAGTTA and TAACTTAATGT
    It should work random inputs too - Expected: false, instead got: true

    ACATTAAGTTA
    TGTAATTCAAT

  • Default User Avatar

    Incorrect solutions are being submitted and voted up not because anyone wants to cheat but because many people didn't see the text below "An easy problem." Be more specific if you want to give constuctive criticism. (and don't wait until someone calls you out to do so)

  • Default User Avatar

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

  • Default User Avatar

    I suggest adding the hint "0! == 1" to the example in the description since it's an exception to the rule/formula shown within.

  • Default User Avatar

    It's also worth noting that this kata appears to expect an input of 0 to output 0 even though that is one zero followed by no other numbers.

  • Default User Avatar

    The creator of the kata figured that input of 0 should return 0... at least that's what I think is happening here. My code worked in tests, but failed on submission until I removed the handling of n == 0. Is a lone zero considered "trailing?" I could not find a definitive answer, so I agree that a single zero should be counted as 1.