57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 1 day ago
Member for 11 years, 6 months, 7 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.
Nice overall idea, but too complicated. tried is completely unnecessary, for example, since base is never decreased. [Here](https://py.checkio.org/mission/checking-perfect-power/publications/veky/python-3/catalan-and-three-bears/) is your solution without unnecessary details. :)
More
It's very awkward how you handle the case when item is a number. I really think it is convoluted code.
More
> The list of banned words are as follows:
sum
import
for
while
reduce
Yeah, right. :-P
More
It just shows how nothing is gained, and much is lost, if you try to squeeze everything in one line. (And yes, walrus is usually the problem there.) Semicolons, mapping lambdas, naming one argument and using name in another, and so on.
If you really wanted to shorten, `iter(a + '_')` wouldn't need
More
This one is the most similar to mine, I guess. But still a bit more complicated. :-)
More
> The shorter your code, the more remarkable you are.
Then I am https://remarkable.com/ :-D
More
Ah, yes, the "sugrically removed recursion" solution. :-D But still, it's nice that you converted it to BFS (queue) instead of the obvious DFS (stack) one.
(Not more than 3+ because you're too anxious about types. In a duck-typed language, it is mostly just nuisance.)
More
There are some weird things going on here. For example, I thought Python doesn't have a character type (different from str). I bet you thought so too. Yet look at line 20.
Calling ord('aa') raises TypeError, calling ord('a') doesn't, but they are of the same type. It seems Guido didn't really mean
More
Yeah, preparing the grid into a graph for Dijkstra is a lot of work. It can be shortened somewhat by factoring those things that are repeated for all four cardinal directions, but it's not easy.
In most places where you can use a tuple, you can also use a list, which helps when it is a 1-tuple, for
More
yes, it's nive that in absence of zeros, two first ducks are in fact the same. 🦆😅
More
An interesting question: why are parentheses needed?
A more interesting question: were they needed in all previous versions of Python? ;-)
More
... Universe, and everything.
Who has actually run this and expected to see 54? :-D
More
A perfectly ordinary solution, but it gives a completely new meaning to the phrase "f-string". :-DD
More