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.
This thread was enough to clarify the description. The description has a bug in it in the example where it has '21' it should have '12'.
I'm also confused by the description. Even the example is helping me. I'd love to take a crack at this one but I don't even know what's being asked.
carry on repeating the operation in the description until all the numbers are equal.
You have an array :
If one element is strictly greater than another, let's say
a < b
, then you subtract the smaller from the greater :And you repeat this again and again until it's not possible anymore. At this stage, you sum all the numbers left in the array and return that.
The thing is (look at the
Additional notes
section), this method is really ineficient. The real task is to find a way to do the same calculation but much faster.I'll agree with this, I believe the author needs to give a much better explanation
It's a problem with your code (yes, it is too slow), not a kata issue.
You're not supossed to multiply that last digit with anything. You should count how many times you need to multiply the number's digits to obtain a single digit number
The single digit value is not related to the expected value.
You're returning the single digit number instead. Please mark your post as having spoiler content next time.