You learned a lot of this language with your solution. As did I with my inefficient shell-script-like solution. And now with this solution you see, that it can be much much easier. Doesn’t have to do much with the language.
Easy to read, easy to understand. Efficiency depends from the compiler, but is probably higher than most other solutions. Perfect!
I must be not suitable for learning this language
Maybe not the most performant because of the recursion, but still quite elegant.
Loading collection data...
You learned a lot of this language with your solution. As did I with my inefficient shell-script-like solution. And now with this solution you see, that it can be much much easier. Doesn’t have to do much with the language.
Easy to read, easy to understand. Efficiency depends from the compiler, but is probably higher than most other solutions. Perfect!
I must be not suitable for learning this language
Maybe not the most performant because of the recursion, but still quite elegant.