Ad
  • Custom User Avatar

    Same issue. Where:

    1. One number has more digits, and
    2. That number has an MSD of 9, and
    3. A carry causes that MSD to itself carry

    the final carry is ignored when counting; it shouldn't be.

  • Custom User Avatar
  • Default User Avatar

    ̶T̶h̶e̶ ̶l̶a̶s̶t̶ ̶o̶n̶e̶ ̶i̶s̶n̶'̶t̶ ̶a̶ ̶c̶a̶r̶r̶y̶,̶ ̶y̶o̶u̶ ̶d̶o̶n̶'̶t̶ ̶c̶a̶r̶r̶y̶ ̶w̶h̶e̶n̶ ̶t̶h̶e̶r̶e̶ ̶a̶r̶e̶ ̶n̶o̶ ̶n̶u̶m̶b̶e̶r̶s̶ ̶l̶e̶f̶t̶ ̶t̶o̶ ̶c̶a̶r̶r̶y̶ ̶t̶o̶,̶ ̶y̶o̶u̶ ̶j̶u̶s̶t̶ ̶a̶d̶d̶ ̶i̶t̶.̶

    edit: actually looking in to it, you're right it should count it as a carry

  • Default User Avatar

    Getting the same issue. My code fails at specific tests. These are tests where one number has more digits than the other, where the longer number begins with 9, and where that 9 would have a carry operation applied to it. My code gets the mathematically correct result, but the test expects one less.

    Either the description isn't informatve enough to tell you to ignore cases like this, or the expected results are wrong. I could throw together something that solves the kata by getting incorrect results, but I'd really rather not do that on principle.

    Should note that I'm using JavaScript in case this is not a problem for other languages.