57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 11 hours ago
Member for 11 years, 6 months, 24 days
Difficulty Advanced
We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.
Inspired by @witmolif's [solution](https://py.checkio.org/mission/funny-adding/publications/witmolif/python-3/hi-how-are-you-doing/).
More
Hm, if you tried to make a chessboard, you didn't quite manage to do it (do you see why?).
See [my solution](https://py.checkio.org/mission/funny-adding/publications/veky/python-3/third/) for a proper chessboard. :-)
More
Wow, fractran! You even use for-else properly. :-D If only you were tidier with spaces, I'd give you five pluses. :-)
More
... and [another snake](https://openclipart.org/image/2400px/svg_to_png/248484/387.png) is [half-empty](https://www.python.org/dev/peps/pep-0404/). :-D
More
Why wouldn't it be slow? You're testing all numbers up to 10**5 one by one. :-o
More
No lambda needed. And no list needed. And in fact no def needed at all. :-D
More
Please use // instead of / when you actually want int division.
More
Binet formula is cool when you want random-access into Fibonacci sequence. But if you need _all_ of them up to a limit, it's much easier to just generate them.
def Fibonacci(limit):
current, next = 0, 1
while current <= limit:
yield current
current, next
More
Wasn't it better, since you already made a copy in line 2, to destroy the copy (lines 7 and 10) than the original argument? :-)
More
> Do not understand how it done
Then how did you write it? :-)
Especially I'm interested in that list(zip(...)) thing. I'm talking about exactly that in one of my VCRs. ;-]
Also, didn't it occur to you to write just _one_ operation, and then iterate it in a loop instead of madly copy-pasting code
More
Very nice. A hint: Python's grammar is smart. You don't need parentheses in lines 7 and 8.
More
Doesn't this duplication bother you? :-)
Also, `def min(*args, key=lambda x:x):`.
And saving one line just to assign min_item to min_item is not a gain. Rather bite the bullet and write `if key(item) < key(min_item): min_item = item` in one line if you really don't want to use another line.
More
If you're going to be witty, at least do it in style. :-P
The "normal", usual case is supposed to be the first (before `if`). The exceptional, "but in case" is supposed to be after the `else`.
More
Was [-1,0,1] too much to write, so you had to say range(-1,2)? :-)
Also, `if rx or ry`. Also later, `if y`. Also yet later, `while islands`. Embrace the bool. ;-)
Why do you give all of the queue to get_neighs, when it only needs the starting element? And then you have to `del` it afterwards. Much
More
Ok, you gave me -3 on my solution, so I go, "ok, this one obviously dislikes complex arithmetic, where multiple cases are brought together in one expression - fine, let's see how they did it". And in your "clear" solution, I find adding the quotient and the remainder of division together. :-O Such a
More