01.07 · Problem
Sum of Digits
Return the sum of the digits of n. Use recursion, no loops.
Examples
Example 1
Input: n = 4096
Output: 19
4 + 0 + 9 + 6 = 19.
solulu Pro
Continue this problem with Pro
Inside: step-by-step hints · 10 hidden tests · reference solutions · code editor.
Lifetime ₹1,999 ₹999 · Launch offer
Item 7 of 44 · updated 2026-10-13