Draft
Digit Sum
60 of 207user3028132
Loading description...
Mathematics
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Seems to be a duplicate of Sum of Digits / Digital Root.
Please add more instructions for negative values. What is the interprtation for the minus sign? should it be just added to the first digit? Not clear enough...
Javascript Translation improved, please review if it can be accepted now :)
The test cases can be tricked easily, at times its giving us negative numbers and other times positive number and depending on the coders luck her can clear the kata easily.
There should be test case: assertEquals(1,Digit.sumDigits(91));
Seems to be a duplicate of : http://www.codewars.com/kata/56bcae6366a2ab99f10011ec
I can help you with the random test cases and possibly better formatting the description; I would do the latter only after you approve the JS translation (if you consider it) to avoid merge problem, but you tell me.
Let's see if we can fix some issue and get this kata approved :)
all done :D
For the method declaration it miss the return type public static sumDigits(long n)
done thanks
For Java:
public static sumDigits(long n) {
public static int sumDigits(long n) {
Return type for the method is missing
done thanks
Duplicate of http://www.codewars.com/kata/541c8630095125aba6000c00
No random test cases
there is no random test cases for ruby, working on that
Ruby: Needs random test cases.
yeah working on it :D
I have translated this kata to Javascript. Consider approving it. :)
This comment has been hidden.
Can I fork your JS translation and add randomized tests?
Yeah sure.. I actually am not that much familiar with randomized tests.
the simple missing return type.
what's missing?, for Java you return an int and its type is clear from the method signature :)
Nice one. Could you add more tests? Many of them and with very high values. I voted, but with stronger tests it would be much better. It needs random tests.
I will add more tests but the random test is a really nice idea thanks.
randomized Java test cases