Recursive Digit Sum

  • + 0 comments

    According to the problem we can say the initial number has at most 10^5 digits. So the initial sum (not considering the repetition time should be at most 9 * 10^5 which can be stored in an 'int' variable. But the problem only can be solved when using 'long' for the sum variable.