We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Recursive Digit Sum
Recursive Digit Sum
Sort by
recency
|
795 Discussions
|
Please Login in order to post a comment
javascript
One-line Python solution:
Java solution
I noticed that some solutions provided here do not work for the simple case when "n" only has one digit but "k" bigger than one, for example when n=1 and k=4 (example input: "1 4") the result should logically be "4". (Note: this test case is not one of the provided test cases).
Java Solution