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.
I'm using JS too, thanks for looking into it
I have trouble with one random test :
89953 922317
which is supposed to output 4
I don't see how it can be, I find 5 when I run it by hand. It would be 4 if the carry was not counted in one of the operation which would be incorrect.
log of the operations :
3 7 +1
carryValue 1
carries 1
5 1
carryValue 0
carries 1
9 3 +1
carryValue 1
carries 2
9 2 +1
carryValue 1
carries 3
8 2 +1
carryValue 1
carries 4
0 9 +1
carryValue 1
carries 5
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm not convinced that this problem deserves an array and an additional function, looks trendy for sure but not allocating that much memory could be more reasonable.