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

Best reviews / Newest reviews
First-QW3RTY
Ok, this is ridiculous. Usually I don't mind some complexity blowup, but n^4 pushes it. And why str(i) each time? More
First-Richard_Lenkiewicz 1
Don't iterate over indices when you can iterate over the list itself. for element in array[0:len(array):2]: sum += element BTW do you really need elif? Can len(array) be less than zero? :-) And while we're at it, a is already 0 in the empty case, you don't need to set it again. :-] More
Concise-pubbin
Nice. Reminds me of definition by cases. :-) Of course, in LaTeX you would have `\\` instead of single `\`. :-D More
Leanfast!-pubbin
Why `and array[-1]`?? Special cases are not special enough. More
First-pubbin
`for spam in map(xform, eggs)` is almost always an antipattern. You're packaging one iteration into an expression, just to evolve it in a suite right afterwards. Since you already have a suite, `map` gives you no ROI. :-) for word in words.split(): if word.isalpha(): ... More
Simple solution-kzantar 1
Many things can be summed, at least conceptually. Look at this: remove `replace_map`, and the transformation in line 8 (`board=game_result`), and replace all `sum`s with `''.join`s (or put `sum=''.join` at the start:). Then, instead of checking for `3` and `-3`, you can check for `XXX` and `OOO`. M More
Sample-VladBark
You really like that `True if condition else False` idiom? `condition` does the same thing. Also, see `any` builtin. More
An orderly queue of one-smilicic
Nice and surprisingly readable. With all those actions, you're only missing some kind of Journal in your architecture. :-P More
Tail call division-smilicic
This is not a tail call. But you already know that. ;-) More
Now I have two problems-smilicic
Now you have two _languages_ that clash. Using % formatting could actually help readability here. ;-) More
wow-VladBark
20 is a magical constant. Much better would be to use `itertools.takewhile`. And x is _really_ slow. In fact it is used by some people as a trivial benchmark. :-) (Most famous example is probably [this one](https://www.youtube.com/watch?v=MCs5OvhV9S4).;) More
First-Undinushka 1
Don't you think your code could use some refactoring? :-) Also, everytime you write if condition: return True else: return False a little python dies. :-P More
Roman Numerals-surenz298 1
Aaargh. Semantically empty names (`newList`, seriously??), the code is _drowned_ in the sea of comments (those things are connected: if you chose more semantical names, you wouldn't need comments!), and most importantly, you're doing iteration wrong. for index in range(0, len(sequence)): ~~~ More
elegant solution-aksenof
You have a weird definition of "elegant". :-P More
Dictionary lookups-johngraham
Ah, a butchering of a nice algorithm. :-P def checkio(data): arabic = dict(I=1, V=5, X=10, L=50, C=100, D=500, M=1000) roman = dict(zip(arabic.values(), arabic)) def fragments(): for exponent, digit in enumerate(map(int, reversed(str(data)))): More
Newbie over comments?-johngraham
This is not "as efficient as possible", but you already know that. :-) It is also not as concise as it could be. Look at [this beauty](https://py.checkio.org/mission/the-longest-palindromic/publications/veky/python-3/although-straightforwardness-beats-speed/). :-) And yes, comments are not really More
Shadow cliques for breaking rings are no basis for a system of government!-smilicic
No, they [aren't](https://py.checkio.org/mission/break-rings/publications/DiZ/python-3/cycle/?ordering=most_voted&filtering=all). :-P `frozenset((u,v))` looks like an identity crisis. Isn't `frozenset({u,v})` better? :-) And you again with your negated set operations. :-P if not set1 - set2: More
:-D :D- -:D -D: D:- D-: D,_-smilicic 1
`_,-1` But seriously... clear? :-D More
Ugly piping-smilicic
OMG. filtering a lambda, then listing it, only to iterate through it. Hard to believe this wasn't intentionally ugly. :-P How about for b, w, n in states: if n == n0: (Indenting 2 spaces is acceptable in such situations, if you're stingy with line lengths.) --- states[(b, w, n)] More