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.
Yeah, that’s why I said :)
Well, that’s quite simple. You transform your integer into a list of integers. Then, each digit
d
satisfies 0 ≤ d ≤ 9. If you double it, you get 0 ≤ 2d ≤ 18. So if d > 4 or 2d > 9, you just have to sub 10 to get the right digit, and add 1. Which is -9. 16 - 9 == 1+6 == 7, for instance.I’m surprised how people understand the sentence “add the digits of the doubled”. The solution only requires a sub, come on guys, no need for digits! :D
Yeah, I forgot what -10 + 1 is. :D