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.
Don't quit, just work your way towards harder kata by doing easier ones. Why were you even attempting a 5kyu kata when you are 8kyu?
Try 7kyu and if you find that too easy, try 6kyu. Don't skip ahead too much as that is only a path to frustration and quiting.
If you find 7kyu too hard, try 8kyu. If you are struggling with that as well then you are really a beginner and must build up some basic programming knowledge which you can do by doing beginner tutorials for your language of choice. Try w3schools, freecodecamp or simply YouTube. Best of luck.
He should automate and write a script that will generate the code for all the numbers.
This comment is hidden because it contains spoiler information about the solution
I did some tests and found this one to be the quickest running of the simple and intuitive solutions.
Thanks. I thought so, but I was making sure since any number with a zero in it would then instantly end the sequence.
Also, 9 * 9 = 81, not 18 in my original comment..
Your multiply_digits function will return 1 instead of 0 when you pass n = 0 into it. It doesn't affect the result of the main function as you will never pass 0 into it since your while loop would break if n was 0, but still not expected behavior.
So, should this multiply zero digits as well or only non-zero digits? For example, if you input 909, you could go 9 * 0 * 9 = 0, and return value is 1, or you could go 9 * 9 = 18 -> 1 * 8 = 8, and the return value is 2.