Given a non-negative integer n, return the sum of its digits.
Example 1: Input: n = 1234 Output: 10
Example 2: Input: n = 7 Output: 7
Constraints: 0 <= n <= 1000000000
Given a non-negative integer n, return the sum of its digits.
Example 1: Input: n = 1234 Output: 10
Example 2: Input: n = 7 Output: 7
Constraints: 0 <= n <= 1000000000
Copyright 2026 Stack Duel. All rights reserved.
Input 1 (integer)
1234
Output 1 (integer)
10