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.
I agree with Marcel completely. Math IS NOT coding. Yes you can use your advanced math knowledge for some kind of shortcuts or speeding up the algorithm, but they are separate skills. I know plenty great mathematicians who are terrible programmers. Probably it is the same vice-versa.
Also, in the text of the task it clearly says "recursive", so I accepted it as a practice in that depratment.
Stop taking things so personally. Admit that the guy could do what you couldn't. And this solution isn't just math; the solution requires you to combine your coding skills with mathematical logic. Otherwise, in only "real life", we don't need to divide by nine and find the remainder; we can simply add all the numbers.
I agree with marcelbrode 100%
A solution like this showcases how the ceiling for coding is raised with advanced math knowledge. It is not the 'best practice' because everyone should be expected to reach this conclusion. It is the 'best practice' because it is the simplest and most efficient solution.
Coding IS math.
What? Using math knowedge is the best way of solving a problem. This solution is many times simpler and more effecient than any iteration based method.