57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 12 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.

Best reviews / Newest reviews
First-kodix09 1
Too much logic. It could all be done with much less branching. More
First-ridhianand16 1 1
Line 4 is a perfect example of what horribilities people go through, just to avoid writing another newline. It's not worth it. :-P digit = int(i) if digit: s *= digit More
First-Bibiche 1 2
This recursion is really misplaced here. Python is not particularly recursive language, depth is cut off after 100 iterations. And [:-1] makes a copy of (almost) a whole list every time. More
First-AHrEJl 1 1
Waitaminute. This is sarcasm, right? And you dare to call my code unreadable? :-O Ok, let's see. * Variable names: data, result, temp, i, val. Completely generic and without any semantic context. temp is as temporary as everything else. result is in fact a negation of real result. val is so More
Dijkstra-Juge_Ti 1 1
Nice solution (as always:). A few details: * For distance, see complex and abs. Or at least math.hypot. * For reachable, you don't have to invert each and every one of them... "all(not blah)" is "not any(blah)". It even seems more readable. :-) * For intersect_cell, you don't need all four More
First-tofguerrier 1
Nice and clear. Of course, Py2.7 is complicated with having to be forced to float division, but still, 12. and 60. in the divisor might be better than H = float(H) and M = float(M). Also, H %= 12 is a nicer way to write that if. More
while & if-Pytato 1 1
Lines 10, 11, 12 and 13 are just return max(wheat, pigeons) Also, I know you know about +=, since you use it in line 8. Use it also in line 14 (and use -= in line 7). Thirdly, condition 0 > a - (b + c) is really weirdly written. It's really just a < b + c. Fourthly, lines 3 and 4 can More
dict & list-Pytato 1 1
You might wish to study str.zfill and dict.get methods. But especially the first one. ;-) u, t, h, T = str(data).zfill(4) You can even "map(int," over them, but that might be too advanced. :-) More
one liner-Sim0000 1
Kinda obvious, but still neat. :-) More
First-Gennady 1
set.intersection has an operator for that, & . Otherwise, fine solution. More
First-Sim0000 1
Line 8 is the most important one. :-D More
Too eager ;-)-veky 1 1
Why is '00:45' not a problem for .lstrip('0')? ;-) More
FP & MetaOOP-flpo 1
Flat is better than nested, indeed. :-D The only thing you missed is that you could write line 25 as cube_volume = 3..__rpow__ :-D More
First-colinmcnicholl 1 1
You're writing docstrings on the wrong side. :-P Also, that action at a distance via changing retlist is much more naturally written using a generator. More
try except-Phil15 1 1
Wouldn't it be clearer if you factored that duplication out? More
I love oneliners!-wasd 1 1
Comprehensions / generator expressions are usually better than higher order functions. map(int, map(methodcaller('replace', ':', ''), entry)) ~~~> int(time.replace(':', '')) for time in entry And your love for oneliners is no valid excuse for that horrible duplication of code. :-P ( More
Complex numbers for x,y position-JamesArruda 1
Yes, of course complex numbers are a natural representation of 2D. But you can go _much_ further. For example, instead of dirs[dir_idx], you can just use (-1j)**dir_idx. The set of complex numbers is not just 2D vector space, it's also a field. ;-) More
GCD spaced-Tinus_Trotyl 1 2
This is one of those rare places where functools.reduce might actually be more readable. ;-P More
With itertools batteries: chain, repeat, starmap-flpo 1
Those Lego bricks really fit into one another. :-D More
The Better Solution-obone 1
"Improvement" depends on the criteria. I surely think that just trying the bases until one works is more intuitive than calculating the maximal digit value --- but of course, the second one is faster. More