16
Mariano Gonzalez Salazar
Last seen 3 years ago
Member for 8 years, 3 months, 2 days
Difficulty Normal
Of course, check my code, lines 13-67 can be done in 6 or 7 lines.
Use a list of neighbors
directions = [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]
and a loop to study each one:
for direction in directions:
ni, nj = i + direction[0], j + direction[
More
Oh now I get what you told me two days ago. I will spend time someday during the week to understand your solution, for me it is like it contains a lot of advanced topics.
More
Wowwwwww I am in love with this solution ^^ I learned a lot!!!
veky, do you think it is a good a idea to base my python learning in only this webpage as a source of knowledge? (and external sources if I have questions)
More
Hi veky. I am a fan of your solutions and comments but I do not understand why you are not documenting your solutions. I know it is up to everyone and I am not complaining about that, I just would love to see all your solutions with comments as nickie did to your solution of this problem.
More
I am sure there are so much things to improve, I will work in a better solution in a future.
More
I think in this case RE makes execution times so long for a simple task like this :/
More
.add(i + 1j*j)
I don't understand what is this doing :\
border = set.union(*({c + 1j ** k for k in range(4)} for c in cells)) - cells
and what about this line?
More