7 kyu
Multiples and Digit Sums
1,040 of 1,693Spherixo
Loading description...
Algorithms
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.
python new test framework is required. updated in this fork
Approved
this kata is not a 7 kyu, i done but i admit that this is more like a 6 kyu
Done
"Try writing it in readable code" would be a better challenge.
changed
Hello JohanWiltink, ejini战神 and everyone else,
There are some very clever guys and gals on here.
But, short code seems to be a 'holy grail' on Codewars the shorter the better!
Short, dense code for me is hard to write but also hard to read --> so both writing and reading takes more time for the human...
The machine doesn't care either way...
Not sure about this, I think there's not a single incentive from the system to directly promote a short code. You don't get points for short code, you dont get additional reward for short code. The only form of promotion of a short code seems to be noobs upvoting short solutions, and, eventually, existence of some golf kata. But one day, they will learn ;)
Hobovsky and everyone else,
Your right! I got a bit carried away... apologies.
I've withdrawn the comment from my original post.
Perhaps, a lesson for me to think more carefully before I write...
I'm not quite sure that this is a 7 kyu kata, or I'm too bad
Hello dani1995ar,
Yes I agree --> keep coding... :)
Ruby tanslation kumited :) please check and approve~~
Avoid using
test.expect
, usetest.assert_equals
insteadfixed with new test framework added
I noticed with this kata that there are problems with the error messages. For example, one of the failed random tests said "41 should be 46". I take this to mean that if the input is 41, the output "should be" 46. However, that is incorrect. If input is 41, output "should be" 15. My first iteration of code was incorrect, yielding a numer of failed tests with error messages that just didn't seem to add up. I believe I have experienced this with other algorithms as well. How accurate are the error messages within the code wars platform? Or perhaps I am simply misunderstanding the error messages? Thanks in advance for any clarification that can be provided. This was a fun kata.
It is a good kata, but would be great with random tests.
Thanks for the suggestion! Just added them, they should work properly.
I think there is a mistake in the description...
Digit sum of each multiple --> [7, 5, 12, 1]
Sum of each new digit sum --> 23
...
7 + 5 + 12 +1 = 25 - not 23
Haha, thanks for letting me know! I used the example in the description to test my solution and it said it was wrong because 25 didn't equal 23, but soon figured out that it was because I counted wrong. I forgot to update it in the description.