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.
awesome, i never would have thought of it that way.
This appears to be very similar to "the best" soution for 6x6 which involves:
Appears to be lighting fast though I do not understand why it works. Probably has to do with bow these kind of puzzles are generated in the first place.
This works really lighting fast on 7x7 except for the last medved puzzle which I suppose was put in to beark this particular solution. So here the modofication is that a limit of 10 cycles is placed on the above approach (for p in range(10)) this presumingly even if does not solve the problem like mdeved problem prunes the sets a lot. and then brute force is used by building a product of (presumingly by the above process) pruned allowed sets of row permutations and testing them.
Would be interesting if authores could come up with an example that would break this solution (like they did with medved that broke the 6x6 solution).
Overall one does not learn much from this solution like one would learn from proper backtracking with extreme pruning.
Yes, the same here! My solution is 100500 times longer than this and for me it seems impressive too! 🤯
Though I am kinda beginner in Python, maybe this is the reason 🤷♂️
I certainly can't say I understand what this code is doing, it's too opaque for me - I'm just impressed that this few lines of code can solve the problem when I wrote far too many!
not to my taste ;p
Efficient enough to make it into the solutions list is efficient enough though, ain't it? :)
nope: it's short, but inefficient like hell... x) (and runs only in python 2.7)
Comments, or just a leading comment explaining the process, would be very useful - great solution.
This seems like a great solution in terms of performance, but the variable naming and lack of functions leaves it very difficult to read.
I just went around that by using // since we know it's always even
By the way that formula was bloody hard come up with
x)
But Python 2 itself is already bad practice ;-)
ah, good point. Forgot about that.
Not in Python 2 ;-)
not best practice: your solution is subject to floating point errors, on big numbers
Loading more items...