38
StefanPochmann
16 38 54 Leader of the month
8978/ 9195
Last seen 12 minutes ago
Member for 9 years, 1 month, 4 days
Difficulty Normal
Recent solutions I'm happy with (just starting/trying this): [Words Order](https://py.checkio.org/mission/words-order/publications/StefanPochmann/python-3/short-dict-subsequence/share/5bbb2df54ec5a810d36d7f70ae7e92da/) Dang it no markdown here?

Best reviews / Newest reviews
EAFP-veky 1 1
Ah, so I guess that's why the input can't just be any value but must be an iterable :-P More
5 liner! using "eval" and "try".-tamagoyaki 1 1
That's pretty bad. Try `postfix_evaluate([2, 3, "/", 10, "*"])`. Causes an infinite loop and memory explosion, because you mistake the float for an operator. If you use `type(v) == str`, that problem goes away, but you incorrectly return 7 instead of 0, both because you round instead of flooring and More
2 line different from Ulam original-dig 1 1
If you're willing to handle float imprecision like that, you might as well use complex numbers. Then you could generate the neighbors of a point `z` simply as `{z + 1j**(i*2/3) for i in range(6)}`, and `almost_equal` of two points could simply be `abs(z1-z2) < 1e-5`. I used complex numbers for the n More
Hold my beer.-veky 1 1
Shortened: def follow(instructions): globals().update(collections.Counter(instructions + 'barfly')) return r - l, f - b More
2-liner: reduce-przemyslaw.daniel 1 1
Another 2-liner :-P ```python beat_previous=lambda D,p=-1,c=0:[[p:=c] [c:=0]for d in D if(c:=c*10+int(d))>p] ``` More
from itertools import not compress-veky 1 2
Inspired me to do it **with** it, here's one version: ``` def compress(items): from itertools import compress, tee, chain, starmap, pairwise from operator import ne a, b = tee(items) return compress(a, chain([True], starmap(ne, pairwise(b)))) ``` Another: ``` def compress(items): More
max len of dict-veky 1 1
Just a variation... long_repeat=lambda l:max(map(len,__import__('re').split(r'((.)\2*)',l))) More
Dunder, map, lambda, sum(bool)... oh my!-veky 1 1
[You're a bit late](https://py.checkio.org/mission/monkey-typing/publications/StefanPochmann/python-3/sum-map-__contains__/) :-P More
Strictly speaking...-StefanPochmann 1
Same as [my other solution](https://py.checkio.org/mission/cipher-dict-decryption/publications/StefanPochmann/python-3/directions-please/share/6d032a971ac33cf1f3f252187039f79f/), except this **can** handle texts like `'\tfoo'`. In that case, the hex string has odd length and `bytes.fromhex` complain More
Generator Fun-StefanPochmann 1
In Python 3.4 I'd make `[]` the max-default. More
vek-StefanPochmann 1
Unfortunately I looked at veky's solution before thinking much, so I can't claim this as my own. I made the regex shorter, though. More
(em)powering-ale1ster 1 1
Nice one, although using `enumerate` would've been better. More
Set comprehension-veky 1 1
Collecting None, sweet. Or is that just to confuse+educate? :-) `0<=ij>=0` would have been nice as well. Or `n>i>-1More
Beans for Breakfast-eraserhead88 1 1
This seems quite buggy. Some test cases (with input, what I'd expect, and what you return): ``` 'ud' None 0 'udd' None 1 'dud' None 0 'udud' None -1 'uddd' None 2 'dudd' None 2 'ddud' None 0 'ududd' None 0 'uddud' None -1 'dudud' None -2 'duddd' None 4 'ddudd' None 4 'dddud' None 0 'ududud' None -1 More
Boring-veky 1 1
Wat. Dat line 14. You must've been veeeery bored. More
by definition-veky 1 1
LOL... those names... I love it. More
Pochmannia!-veky 1 1
Hmm, now what to do with this... I gave the original +5 for its neat insight/algorithm. I do like this version better, but it didn't give me that same Aha! moment again... More
The power of excluded-Lemmi 1 1
The power is not enough to handle `create_intervals({0, 1234567890})`, crashes with a `MemoryError`. But still a nice idea. Second line can be simpler/shorter: return [(x + 1, y - 1) for x, y in zip(ex, ex[1:]) if y - x > 1] More
Something from Nothing-StefanPochmann 1 1
Alternative title: "FOO, BAR, ..." More
1 2
3
4 5 6 7 8 9 10