Ad
  • Default User Avatar

    yes, Sry about that. I had trouble with running code and didnt know what else to do. Then i realised maybe i should try and return empty list for empty input. It worked.

  • Default User Avatar

    I tried to print the input provided via test cases but it printed an empty string. I cant do operations on empty list. If anyone could help with this it would be great. Thanks.

  • Default User Avatar

    nvm i tried to explain and i dont know how to delete the comment so im editing this.

  • Default User Avatar

    might not need to store all the data in list when you can return value with first occurence.

  • Default User Avatar

    thanks i didn't see 'question' tag my bad. This should help me out with the solution.

  • Default User Avatar

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

  • Default User Avatar

    it simply means you have to multiply digits of entered number repeatedly until you get one digit. so suppose for 27> 27=14(but 14 is 2 digits, so we repeat )>14=4(now we got a one digit number). As you can see here we had to multiply 2 times to get to one digit. Therefore our output is 2.