Ad
  • Default User Avatar

    Good point, thanks for the suggestion.

  • Default User Avatar

    Glad it helped, the kata is nice!

  • Default User Avatar

    You can check mine out, although pretty sure there are better ones out there.

  • Default User Avatar

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

  • Default User Avatar

    Ok so I did have a mistake in my code, I fixed it and now it passes everything. But when it didn't it had incorrect description for some of the tests. For example:

    Testing for:
    product = 172
    ✘ Expected: 22, instead got: 4

    My answer is wrong here as well, but the test should expect -1, not 22. Weirdly, when I corrected my code everything passed. So the problem seems to be not in the tests themselves by somehow in the description.

    EDIT:
    Posted my old code so you can replicate the error. Maybe just worth double-checking those tests. I think you can narrow it to the cases when the expectation should be '-1'

  • Default User Avatar

    I pass all the example tests, but when I click submit it fails for one digits as shown above. E.g. it expects 23 for 6

  • Default User Avatar

    Very interesting kata! But what about single digits? I keep getting failed tests like this:

    Expected: 23, instead got: 6

    If the product is 6, the smallest integer should be 6, or, if you want at least 2 digit number, 16, or am I missing something?