Ad
  • Default User Avatar

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

  • Default User Avatar

    Hi, and welcome to Codewars,

    Yes, your problem is that you are returning the "string" shown in the Description (really cool solution by the way!) but all the kata wants you to do is return the final result, as an integer.

    So in the above example, just rewrite your code to return 2 (an integer) rather than the whole string with the --> etc.

    By the way, for future reference - if you are unsure about what is required for you to return in any kata, you can check the "Sample Tests" in bottom right of your screen - for example, here you will see:

    test.assert_equals(digital_root(16), 7)

    which means that, for input of 16 your code should return 7. That allows you to conclude that the kata wants you to return an integer as the result.