57
veky
22 48 64 Leader of the month
44668/ 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
Brainf**k-ciel 4 1
Nice idea, but please watch the video "stop writing classes". ;-] More
Connecting the dots-veky 3
@oduvan: Much improvement. I usually solve your missions with just one import from stdlib, now I had to use three. :-D More
slice-gyahun_dash 3 1
Cool. Not really general, but here is a nice hack someone might find amusing: you can replace max(0, x - 1) with x - bool(x). ;-) More
First-bunnychai 3 1
Nice and straightforward. In fact the same algorithm as my solution:-). But function check is really confusing. Line 13 should be just if x*3 in flat: Don't you agree? More
Clear and pythonic-nakanohito_piyo 3 1
Namespace dicts are usually initialized via kwargs. dict(e=1, a=1, i=1, ...) [Of course, you might argue whether VALUES _is_ a namespace dict, but I think the readability gain is positive anyway.:] --- Otherwise, as opposed to many solutions that are claimed to be clear and Pythonic, this on More
BFS-htamas 3 1
Do you _really_ write this on your mobile phone? And does it have Python installed? :-) More
First-skyJuice 3
You can use builtin sum instead of coding it from scratch. And use unpacking in for. return sum(grid[row+dr][col+dc] for dr, dc in moor if 0 <= row+dr < len(grid) if 0 <= col+dc < len(grid[row])) More
Toad-veky 3 2
This should be fast enough for you performance fetishists. :-P Explanation of a title, since I've seen many people not get the point of my titles: Besides hopping as a toad from state to state, this is also ugly as one. :-P Also see the `)):` in line 33. Python is very sad. :-( More
Set of edges-nickie 3 1
frozenset is much simpler than tuple of sorted, since there are no repetitions. itertools.chain is an overkill (fortunately you didn't use itertools.chain.from_iterable, a powerful function with a horrible name:). set().union is all you need. ;-) BTW the "chopsticks" in the last two lines are real More
First-Uladzimir 3 1
abs is a function, no need to lambdize it. :-) More
First-gflegar 3 1
1. That converting to binary (BTW did you know about bin function?) has way too many parentheses for my taste. :-) 1<< has too low priority, 2** has big enough (and optimizer is smart enough). Outer () around bool are superfluous, probably a remnant of C casting thinking:-D. And cast to bool is not More
First, brute force (dark force?)-Thenbacker 3 1
Nice and straightforward. bools can be used arithmetically in total += (p>e) - (pMore
First-michael.kej 3
Cool. :-) You can use .count('1', 2) to be explicit you're starting to count from position 2 (here it doesn't matter, but it could if someone decides to count zeros instead). More
defaultdict-ciel 3 2
As you see from the comments, methodcaller is good from educational point of view. :-) But there is a much easier way: just use unbound method. map(str.split, calls) More
Sorted-t4n017 3 1
Much clearer: define min_max with its true signature (reverse:bool, *args, key=None) and say min = functools.partial(min_max, False) max = functools.partial(min_max, True) More
First-Sim0000 3
Why is `check` a separate function? Considering the context, name is not really very semantical. And if you really want a function, for c in filter(check, message) would probably be nicer. More
Union Find-bukebuer 3 1
Nice UF. But of course you don't need a class. Line 44: You don't need `list()`. In fact you don't need `set()` either. ;-] Line 45: `sorted(eggs, key=spam)[-1]` is also known as `max(eggs, key=spam)`. Timsort _is_ damn fast, but max is linear. :-) Line 19: see `dict.fromkeys`. Very useful and fe More
First-gflegar 3
1. sequences are boolable. "if not l" is more pythonic than "if len(l) == 0". 2. candidates can be written as a big list comprehension (again, it doesn't have to be in one line, in fact it can have the same structure as your original lines 6, 7 and 8). 3. range(0,10) is just range(10). Think o More
WordsFinder-bunnychai 3 1
re is obviously an overkill here. With the necessary escaping it is even longer than ordinary index (or my approach:). And you don't even use IGNORECASE. Nice use of bisect.insort. :-) That ugly offset calculating can be completely removed, if only you replace "enumerate" with "reversed" in li More
Recursion-ichaleynbin 3 2
Much more pythonic is: def checkio(data): try: return data[0] + checkio(data[1:]) except IndexError: return 0 EAFP. ;-) More