Skip to content
U
uByte
Tutorials
🐹
Go
Beginner-friendly
🐍
Python
Clean & readable
🟨
JavaScript
Web & Node.js
☕
Java
Enterprise & OOP
🦀
Rust
Systems programming
⚙️
C++
Performance & control
💜
C#
.NET & game dev
Interview Prep
🎯
All problems
Browse every language
🐹
Go
🐍
Python
🟨
JavaScript
☕
Java
🦀
Rust
⚙️
C++
💜
C#
⚡
Daily challenge
One new problem every day
🎤
Interview simulator
Timed mock interview + AI debrief
💬
Interview experiences
Real stories shared anonymously
Certifications
📝
Certifications
Coding exams by language
🐹
Go
🐍
Python
🟨
JavaScript
☕
Java
🦀
Rust
⚙️
C++
💜
C#
U
uByte
// Sum of Digits — EASY
// Category: math
Given a non-negative integer `n`, return the sum of its digits.
For example, `sum_of_digits(123)` returns `6` (1 + 2 + 3).
Example: n = 123
Output: 6
Sum of Digits — Pro only
Sign up free to start solving problems. The daily challenge is always free — no account needed.
BEST VALUE
Yearly Pro
$49.99/year
Save $69.89 vs monthly
Monthly Pro
$9.99/month
Cancel anytime
Create free account →
Already have an account? Sign in
← Back to Go problems