Ad
  • Default User Avatar

    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.

  • Default User Avatar

    He should automate and write a script that will generate the code for all the numbers.

  • Default User Avatar

    Multiplying by 0 will still bring num to single digit.
    Treat it like any other number.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I did some tests and found this one to be the quickest running of the simple and intuitive solutions.

  • Default User Avatar

    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..

  • Custom User Avatar

    Zero counts as every other digit, it should not be skipped.

  • Default User Avatar

    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.

  • Default User Avatar

    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.