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.
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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hello.
If you meet an exponential form, you might have chosen the brute-force solution: (1) generate the full answer, (2) then use some ways to check the digits at the end, (3) then judge whether they are zero, (4) then add your counter if there is another zero.
However, there are some other ways to count them, especially when there are some patterns.
Another possible way (I think I can expose that the n in test cases are not that formidably large) is to handle the multiplication (to say, when the product > 10000000) yourself. You will need a list or an array to do that: if you use a list of integers (just name it as l), you can use l[0] for the highest (or lowest) digits, and operate as you were in classrooms of arithmetic. You can make your coding easier by have one digit per element, or use different base (e.g. 1000, 1000000, or 65536 or something alike).
This comment is hidden because it contains spoiler information about the solution
Think about this case: "1,1,3,4,1,9"
Result must be: 9 (because ONE 1 and ONE 9 is NOT used for the addition) Your solution would return 7.
"array.length < 3"?
Why 3?