leetle

Daily challenge for 2025-06-08

159. Sum of Digits Until One Digit

Write a function solve that repeatedly adds all the digits of a non-negative integer until the result has only one digit, and returns that digit.

Example:
Input: 38
Output: 2
Explanation: 3 + 8 = 11, 1 + 1 = 2

Run this challenge interactively in Python or JavaScript when the app loads.