Draft
Digit Sum
60 of 207user3028132
Description:
your task is to implement a method/function that takes a posistive integer and returns its single digit sum of digits **i.e. keep summing the digits till only one digit remains.
Examples: //for Java
sumDigits(4523) = 4 + 5 + 2 +3 = 14 = 1 + 4 = 5
here sumDgits(4523) should return 5
sumDigits(65536) = 6 + 5 + 5 + 3 + 6 = 25 = 2 + 5 = 7
here sumDgits(65536) should return 7
Examples: //for Ruby and Python
sum_digits(4523) = 4 + 5 + 2 +3 = 14 = 1 + 4 = 5
here sum_digits(4523) should return 5
sum_digits(65536) = 6 + 5 + 5 + 3 + 6 = 25 = 2 + 5 = 7
here sum_digits(65536) should return 7
Mathematics
Similar Kata:
Stats:
Created | Oct 21, 2015 |
Warriors Trained | 343 |
Total Skips | 7 |
Total Code Submissions | 727 |
Total Times Completed | 207 |
Java Completions | 60 |
Python Completions | 120 |
Ruby Completions | 44 |
Total Stars | 8 |
% of votes with a positive feedback rating | 88% of 120 |
Total "Very Satisfied" Votes | 101 |
Total "Somewhat Satisfied" Votes | 10 |
Total "Not Satisfied" Votes | 9 |
Total Rank Assessments | 130 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |