Exercises/#101 Sum of Digits
#101

Sum of Digits

EasyπŸ”’ Math & Numbers
30 XP

Problem

Given a non-negative integer, return the sum of its digits.

Examples

Input: n = 493
Output: 16 (4+9+3)

Input: n = 0
Output: 0
mathstring
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

101 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features