Problem
Given an integer number $n$ calculate sum of its digits recursively: repeatedly add all its digits until the result has only one digit.
Complexity
- Time: $O(1)$
- Space: $O(1)$
Recursive Digit Sum (HackerRank)
Recursive Digit Sum | HackerRank
Given an integer number $n$ calculate sum of its digits recursively: repeatedly add all its digits until the result has only one digit.
Recursive Digit Sum | HackerRank