Write a method to calculate the sum of digits of a given number.
MediumProblem Statement
Write a method to calculate the sum of digits of a given number.
Sample Input
12345
Sample Output
15
Limits
Time: 2s · Memory: 256 MB
Write a method to calculate the sum of digits of a given number.
12345
15
Time: 2s · Memory: 256 MB