Sum of Digits

Easy
Math Math

Given a positive integer, return the sum of its digits.

Constraints

1 ≤ n ≤ 10^18

Examples

Example 1:
Input: 123
Output: 6
Example 2:
Input: 999
Output: 27
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.