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 is the exact concept I tried to capture in my solution with (what I think is) more readable but probably way less performant. Awesome solution man!
I'll just say this: I have the building blocks for how this should work. I've accomplished it within 15 minutes in SQL Server and translated most of the syntax over to Postgres.
I have to admit that the way tests are set up for this Kata are profoundly unfriendly compared to other SQL Kata. Getting into the nitty gritty of what we can do vs what we can't in Codewars is difficult.
All of the test cases are NxN, at least in C#. Maybe the cases have changed since you commented, but for anyone else looking at discourse you shouldn't consider jagged or rectangular arrays.
You can use the console temporarily to see what cases are being run, but there is a performance impact you should be aware of when submitting.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This was a great Kata. Similar to other solver feedback, named Tuples would have been a nice to have (but I think your approach seems very common on code wars). Another minor point of feedback is that I totally missed for an attempt or two the fact that puzzles can be rectangular. In hindsight, it's very obvious, since you have width and height variables, but with the square example I got a bit lost in the sauce. Finally, a very very minor grammatical point: In notes, I would change "Be careful about performances" to "Be careful about performance".
A lot of the solutions I've seen were huge and/or O(n2), I believe this is solvable in O(n).
Thanks for your work!
Love how succinct this code is.
This comment is hidden because it contains spoiler information about the solution
Same issue:
Traceback (most recent call last):
File "main.py", line 12, in
for _ in xrange(1000):
NameError: name 'xrange' is not defined
This comment is hidden because it contains spoiler information about the solution