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.
While clever, I don't think that this solution has the same readability as some of the other solutions.
+1 this solution is clearly not optimised
Another way to do it is to preallocate the capacity and then use append with the ... operator. Eg: results = append(results, signature[:n]...)
there are 3 unnecessary loop iterations
i := 0
=>i := len(signature)
I guess append() would create a new slice each time it cannot fit the numbers anymore, so it might be inefficient compared to creating a slice the size of
n int
in the first place. Although the code is really clean and short, I liked that.UPD: Oh! And a slice created like that will address the underlying values of that array, you should use predefined
copy()
function.This comment is hidden because it contains spoiler information about the solution
approved.
This comment is hidden because it contains spoiler information about the solution
Go transtaltion available for review.
Go transtaltion available for review.
Here is my translation.
Any comments are very much welcome.
There is way to optimize a brutal force approach (with it's being a brutal force approach)
Try to think how the runtime is calculated and where you might be able to limit it
Really enjoyed this kata!
There's a great presentation on youtube by David Beazly about meta programming in python. Just search "python meta programming". It covers basics in python 2 and new features of python 3.
Thanks again for this kata, there aren't many such katas that leverage cool features of the language.
Thanks for the nice kata.
I have a question. Does this kata requires some sort of optimized algorithm?
Because my solution works but fails due to the long run.
My algorithm is a straigh forward approach. At first I eliminate the obviously wrong candidates for each cell and then I try all the remaining combinations.
I would appriciate a hint ;)
Loading more items...