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.
OP solved it, closing
This comment is hidden because it contains spoiler information about the solution
What's the difference?
Do you pass the challenge?
How did you deal with bug arrays?
Why do you think those symbols were all the same? Or all different?
They were all represented the same, but that's not the same thing.
I was able to get the test to give me a pass. But my code was definitely not fully functional. This kata might need more test cases.
It's somewhat difficult to tell what to search for, because you do not need to use any specific function or language construct here. You need a good idea. You already noticed that
parseInt
will return unvalid result for large arrays. Now the question is, do you really needparseInt
? Can you perform the operation ofadd 1 to a number expressed as array of digits
without building a value out of the array? Actually you can! For example, you can use the same algorithm you do when adding long numbers on paper:It's one possible way.
I had the same question. Still trying to figure it out.
It's likely just an older solution when
const/let
weren't formally adopted in javascript yet.