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 only works cause uses a named return type. If his variable would be called sum1 it would return nothing.
Starting the loop from 0 is unecessary, wasting an iteration. Just a small detail
Use spoiler flag next time please.
This comment is hidden because it contains spoiler information about the solution
Really interesting) I've never seen that we can just return w/out specifying the variable to return
Nice solution! I believe you don't need to use strings.Split(), since 0 <= x <= 4 and 0 <= y <= 4.
i think this is nicest code structure
I did that in my solution
How can this be voted best practices? It is very slow and only work with ascii strings 🤔
A recursive version if not optimized at compile time generate extra assemby instruction for creating/destroying a stack context for a function call. The context contains temporary variable, caller arguments, and the return for the instruction pointer. Iterative version keeps the same stack context, no need to manage life cycle of called context, so it's faster cause less instructions to execute.
A teminal recusion can be easily optimized at compile time can be do by «de-recursivate», i.e. transform a recusive algorithm by an iterative one through the use of its own stack with a fast use of this stack. GCC do that for example.
why? Is it not good for performance?