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.
Why solutions like that get Best Practices mark: this is definetly not the best practice as you go (and process) entire array
This is not clever way the loop must be terminate if value found but this code will loop till the end
The brain almost storming to count and understand the recursion call line ... bravo!
@xehpuk, you are correct, my mistake, thanks!
What concatenation? This solution uses basic arithmetic. Simple and performant.
But the use of concatenation in loops (or recursions) is an awful practice. Should remember during daily work.
It's true, thanks for replying!
99/10 results in 9, not 9.9. Integer division.
I got confused, for example with the entry n = 99.
I know that in the first step of the recursion the result is 81, but when It comes to the next step, the conditional gives you that you have to square the BASE (1010) and this is multiplied with the function with the entry (99/10)
and back to the function again, 9.9 is minor than BASE, so I return 9.99.9 and this is multiplied with (10*10) and this is summed with 81 (the first step) and the result is 9882, which I don't understand why is not correct. Please can you explain how it works with this specific example??
This is the most clever solution I've found here!!
I like it a lot, thanks for sharing
Very short and readable. Good !
I don't understand... why this solution is not at the very top? It's the best!
Wow !
All ingenious is simple.