Ad
  • Default User Avatar

    Hey I'm reducing maintenance costs by reducing lines of code! :D

  • 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.

  • Default User Avatar

    Having finished the kata, I don't think the edge case of step === 0 is explained properly. There's a single example but no explanation of where the solution comes from. You basically have to guess as to what the kata wants. I think the description should be edited to include some kind of instructions for when step is 0.

  • Default User Avatar

    Your if statement only accounts for when i1 is less than i2. If i2 is less than i1, and both are greater than -1, then the code inside the if statement is ignored, and the while loop goes on forever.

  • Custom User Avatar

    It's the same issue as the one below, closing this one.

  • Default User Avatar

    The description isn't super clear. It first asks only for 1x1x1 cubes, but the example tests for both 1x1x1 and 2x2x2 cubes. What it really wants is the total number of cubes of any size that will fit inside the box.

  • Default User Avatar

    This solution is hilarious, but who voted best practices on this? It's basically unreadable.

  • Default User Avatar

    Left some debugging stuff in there on accident. Some print statements and an unecessary break command. I meant to test it again after I made a small change and didn't notice the button said "Submit" and not "Attempt." Woops.

  • Default User Avatar

    Realizing now I left an unecessary binary to decimal conversion method in there...

  • Default User Avatar

    It works per the description of this kata. All arrays given are made up of the same number except for one entry. {1,1,1,2,3,3,3,3,3,3,3,1} wouldn't be given as an input.