Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
please don't say anything bout it...
for cpp at least is for sure 4kyu
And again, nowhere it says you need to calculate the digital root or digital sum, it says the sum of its digits.
Please, stop discussing something that's obviously in your mind, how would you describe the sum of the digits of a number? That's what it says, literally. Read better next time.
Wikipedia shouldn't be your source,
In mathematics, digital sum and digital root are the same concept, since there is no functionality to just iterate the digits once. I wouldn't have argued with you, but you had to come with your downvote and a BS response.
You're talking about digital root, and nowhere it tells you you have to do that here.
You can see the sum of the digits has two digits in the example in the description too. It's a literal sum of the digits, your mistake.
The digit sum is recursive in mathematic.
if its over 9 you calculate the digit sum till its under 10.
But I guess we can start calling anything to whatever we want.
1 + 2 + 3 + 4 = 10
dotest("2000 10003 1234000 44444444 9999 11 11 22 123", "11 11 2000 10003 22 123 1234000 44444444 9999");
expected is wrong, or am i mentally delayed?
1234000 = 1 + 2 + 3 + 4 + 0 + 0 + 0 = 1 + 0 = 1
why do we expect it to be 5?
I wrote it with c++. It has been a while since I wrote c++ or use this website.
If anyone want to check my solution: https://www.codewars.com/kata/reviews/5d5ed826ad2c6800010db5d3/groups/627fcd97d6bf32000121cd8e
I would love if someone has any better practices to suggest to me.
Thanks!