Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hey I'm reducing maintenance costs by reducing lines of code! :D
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.
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.
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.
It's the same issue as the one below, closing this one.
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.
This solution is hilarious, but who voted best practices on this? It's basically unreadable.
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.
Realizing now I left an unecessary binary to decimal conversion method in there...
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.