6 kyu
Simple Fun #36: Most Frequent Digit Sum
115 of 355myjinxin2015
Loading description...
Puzzles
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.
JS fork
mocha/chai
assertions +lodash
for randomnessLua translation !
python new test framework is required. updated in this fork
Approved
C# tests generate warnings -->
tests/Fixture.cs(94,15): warning CS0219: The variable 'passed' is assigned but its value is never used
Ruby translation should be updated to version 3.0, see relevent information here: https://github.com/codewars/content-issues/wiki/List-of-Ruby-Kata-to-Update
Haskell : https://www.codewars.com/kumite/5b8b387174a4f44a0c000071?sel=5b8b387174a4f44a0c000071
R translation kumited!
Please carefulyl review and approve! Reference solution and tests are commented. Your random test structure is a little counter-intuitive for me, so rather than try to replicate it exactly, I just made the distribution of input sizes similar. Let me know if you'd like any changes!
Approved. Thanks ;-)
This comment has been hidden.
If i may permit myself, testing against random data is a bit risky. There's a non-zero chance that either your test case rejects a right algorithm or accepts a wrong one.
I stumbled upon one of such genre : Test.assertEquals(answer(19), 9); -> it's actually 10
How's that possible? Well, random data, I don't know.
Then I submitted again and... no more failure!
It seems you are right, I'll check it later. now I'm using a cellphone. Thanks ;-)
Sorry, I've check it. But whether it is in fixed tests or random tests, my function always returns
10
, instead of9
. I'll mark this issue as resolved. If you've found any other issue, you can post it again. Thanks ;-)No bother man! Thanks a lot for your work
Same issue here: expect_equal( most_frequent_digit_sum(17),9), while it should be 8.
First sequence:
17, 9, 0
Second sequence:
8, 9, 0
So the right answer is 9, not 8
This problem with 19 is still there in the R version.
answer 18 for test 9999? not 9?
For n=9999 The decreasing sequence is: 9999,9963,9936,9909,9882,9855...0 s(x) === 9: 195 numbers s(x) === 18: 330 numbers s(x) === 27: 84 numbers s(x) === 36: 1 numbers So the result is 18
thx! i just misunderstood the problem :)