34
Last seen 9 days ago
Member for 7 years, 6 months, 16 days
Difficulty Normal
Thanks for sharing this! I was not aware of this module in the scipy library.
More
Another nice solution with `scipy.ndimage.label`, which I also used again in my solution :)
I like the fact that you used generators instead of producing an array or set.
More
Nice solution! You can simplify your graph function and remove the initializations of the neighbour dict in
neighbour={}
for el in alist:
neighbour[el[0]]=set()
neighbour[el[1]]=set()
for el in alist:
neighbour[el[0]].add(el[1])
neighbour[el[1]].add(el[0
More
Nice solution!
Instead of defining a `print_health` method, I would rather redefine the `__repr__` function of both `Army` and `Warrior` classes
More
Upvoted for the comments, the nice solution and the use of pytest :)
More
Thanks. I like numpy and I try to use it where it makes most sense. Glad that it is useful for somebody else :)
More
Fascinating solution. Could you please explain how the algorithm works? Thanks
More