7 kyu

Multiples and Digit Sums

1,040 of 1,693Spherixo
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • Lockcrowley Avatar

    this kata is not a 7 kyu, i done but i admit that this is more like a 6 kyu

  • ejini战神 Avatar
    • Node 14 should be enabled (Refer this and this for more info)
  • JohanWiltink Avatar

    If you can, try writing it in one line of code.

    "Try writing it in readable code" would be a better challenge.

    • ejini战神 Avatar

      changed

      Suggestion marked resolved by ejini战神 3 years ago
    • arthur2001 Avatar

      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...

    • hobovsky Avatar

      This has been discussed many times before --> but I think the system promotes it...

      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 ;)

    • arthur2001 Avatar

      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...

  • dani1995ar Avatar

    I'm not quite sure that this is a 7 kyu kata, or I'm too bad

  • ejini战神 Avatar

    Ruby tanslation kumited :) please check and approve~~

  • anter69 Avatar

    Avoid using test.expect, use test.assert_equals instead

  • efw Avatar

    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.

  • Caders Avatar

    It is a good kata, but would be great with random tests.

  • daddepledge Avatar

    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

    • Spherixo Avatar

      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.