57
veky
22 48 64 Leader of the month
44584/ 53887
Last seen 22 hours ago
Member for 11 years, 6 months, 6 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-bryukh 1 1
Lots of "special" cases that aren't really special. See mine for general solution. ;-) More
Sum of chr-DiZ 1 1
Funny, this is exactly the same length: safe_pawns=lambda p:sum(bool({chr(ord(c)+o)+chr(ord(r)-1)for o in(-1,1)}&p)for c,r in p) More
defaultdict-Leonix 1
You can use `int` instead of lambda:0. And of course, you can use Counter instead. More
First-tuxninja 1
Line 12 is unnecessary. Much better is to inline it. Naming something "count" is in no way clearer than "data.count(d)". More
First-taras-sereda 1
When you use something as a name, try finding if there is already a builtin. Specifically, max with key. ;-) Also, collections.Counter might be of help. More
The meaning of life-Sisyphus 1 1
... Universe, and everything. Who has actually run this and expected to see 54? :-D More
3D-veky 1 2
Another use for my universal A* mixin. Of course, the obvious way to think about the problem is to put in in 3D, with "not carrying a box" and "carrying a box" along z axis. Start and goal are in the top layer, B cells serve as stairs connecting layers, and distances are twice smaller in the bott More
same as everyone else's-pietroppeter 1
> same as everyone else's You'd be surprised. :-D More
First-nptwz 1
Just out of curiosity, do you really, honestly consider your solution _readable_?! Mixing lists, tuples and strs without any plan or order, tackling those "or ld.count... or rd.count..." on like an afterthought (which it probably is) instead of mapping through them too, using max instead of any ( More
Spelled out-TomTerebus 1
More importantly, every if cond: return 1 else: return 0 is simply "return int(cond)". Switch is not if/elif/elif... here, but simply a dict. But this is not so important as what I said above. More
First-UndeadMonkey 1
Don't you think this code duplication is horrible? :-P And even that's inconsistent, since units are handled differently than tens and hundreds. Why tab (== lookup) as a separate argument? It's not that it ever changes. Just use that local variable. Why str(tab[...]) instead of just tab[...]? str More
Clean and simple-dshorstein 1 1
Could be cleaner if you removed the parentheses after return. Also, relational operators (`>`) should always have spaces around them if you want to follow advice from PEP 8. :-) More
Password Checker (input mask)-UndeadMonkey 1 1
First, at the start, you need or. if len(data) < 10 or data == data.lower() or data == data.upper(): return False Or even better... ... or data in {data.lower(), data.upper()}: You don't need line 11. list is iterating through your str the same way for would do. for item in More
First-fishiwhj 1 1
Aargh. Don't write C# in Python. And _please_ don't use pseudoHungarian notation. It completely misses the point of Python. Also, learn Python idioms. Many of your lines can be written in a clearer, sometimes even point-free way. In some cases you don't even need to learn new idioms, just use them More
First-flpo 1 1
There is a derelict batery inside re that does that dirty work for you. Look at [my solution](https://py.checkio.org/mission/reverse-roman-numerals/publications/veky/python-3/another-derelict-battery/?ordering=most_voted&filtering=all) to learn about it. ;-) More
Folding-ale1ster 1
This solution reminds me of that silly task "Count the number of F's". :-D More
8 times a 45° sector-Tinus_Trotyl 1 1
Now do it with complex numbers. :-D More
difference-McMan 1 1
You don't need list(). And you don't need len() either. ;-) More
recursive sum-McMan 1
Why didn't you just put s=0 in line 1, then you don't need line 2 at all? Also, len() is unnecessary. Sequences are boolable. More
Remembering steps-LukeSolo 1 1
Instead of type(,,), use class. It's not so old-fashioned. :-P Instead of defaultdict(int), use Counter. Much more explicit. ;-) Instead of subclassing tuple, use complex. It naturally adds by coordinates. ;-] And instead of tuple(map(lambda: setattr...)), bite the bullet and write a for loop onc More