Find the sum of the digits of a number until the result has only one digit.
MediumProblem Statement
Find the sum of the digits of a number until the result has only one digit.
Sample Input
1234
Sample Output
1
Limits
Time: 2s · Memory: 256 MB
Find the sum of the digits of a number until the result has only one digit.
1234
1
Time: 2s · Memory: 256 MB