57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 21 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
Tribute to @veky-z00sts 1
If you're writing a tribute to me, at least drop brackets inside parentheses. sum(x for i, x in enumerate(array) if not i%2) But in fact, slicing is much simpler. You can use itertools.islice if you worry about memory. More
dict-Sim0000 1 1
Why dict instead of just a list? Also, those lambdas don't need to have the same arg specification, you can name them better than a[...]. More
First, long and messy-Thenbacker 1 1
OMG. The dreaded "else: pass" pattern. :-D Also, why do you check for tuple at some point? (and for list at another!?) The code shouldn't depend on exact types passed into min/max. More
First-Wei5 1 1
I don't get it, why don't you just import hashlib directly?? More
kabopan-ciel 1 1
What's wrong with you people? :-) More
First-AliJoohy 1 1
Why do you think you need line 6? It's an important question. :-) More
First-AliJoohy 1 1
You invented a new pattern: iterecursion. :-P And you were very close. You just needed to drop the lower half of your code. :-D for value, notation in roman.items(): repeat, num = divmod(num, value) yield notation * repeat More
Second, controlled oversampling (more effective)-Tinus_Trotyl 1
Wasn't it easier to do that `set(connection.split("-"))` thing only once? :-) Also, `break else return` is a powerful pattern that's better than bool flags. See [my solution](https://py.checkio.org/mission/find-friends/publications/veky/python-3/tinus-trotyls-pythonified/) for implementation. :-) More
Using Counter class-johngraham 1
Why not just return first_counts == second_counts ? More
Any N-dim cube, any cube edge side-vikulin 1 1
Yeah, something like that. Just a few Pythonic nitpicks: dim and width can be (kw-only if you're paranoid:) parameters to checkio. def checkio(edges, *, dim=2, width=4): [Even better would be to _infer_ them from `edges`, and that is what I really meant as a challenge, but I see it wouldn't More
First-BossRaker 1
What's this epidemic separation of return with two empty lines from the rest of the function?? Where do you get this idea, people? :-/ More
First-mroth 1
It's funny how your naming quickly deteriorated from most_wanted_letter_alpha # wow, I'm feeling so powerful to a # ah, to hell with it already! :-D More
Naive-Sim0000 1
This is not as naive as it seems. :-) More
First-nbaramichai 1
Interesting idea to use numpy to solve the system. However the system is modular, so you have to guess k (additional number of turns) so the whole thing becomes a bit clumsy. (But still, explicit loop would probably be better than recursion with a default parameter.) Numpy _can_ be exploited to More
2*54-veky 1
Too bad attempts aren't reversed (divisor,remainder) - then {d for d,m in a} could be set(dict(a)). ;-) More
O(1) (space, of course:)-veky 1
Up to the input, which is immutable (tuple of str), this has a **constant space** complexity - that is, it writes to a fixed number of memory cells, no matter how long the input is. It shows directly how beautifully iterators fit together. I don't think any other solution satisfies that criteria. A More
One-liner with magic number-suic 1 1
26 is not so magical. I expected 2847 or something like that. ;-D More
First-Happiness 1 1
Seems ok. But you don't have to make tmp (as a name) and lstext (at all). Try this :-) import re p = re.compile(r"\W+").split def checkio(t, l=len, V = "AEIOUY", z=zip, S=sum, m=map): def s(w): if w.isalpha() and l(w) > 1: for c, d in z(w, w[1:]): More
(Parentheses)-veky 1
For all those who wondered how my "golf course" looks like in the zeroth iteration. I intentionally didn't "compress" any of this code, this is what I wrote directly. Compressing the above is left as an excercise to the reader. :-D More
First-lsdda 1
Lines 2, 3 and 4 can be written at once: tlist = list(filter(str.isalpha, text.lower())) or if you don't like unbound methods, tlist = [x for x in text.lower() if x.isalpha()] Line 5: please avoid semicolon if in any way possible. "show, counter = 0, []". BTW why "counter" name f More