38
StefanPochmann
16 38 54 Leader of the month
8978/ 9195
Last seen 5 hours ago
Member for 9 years, 1 month, 3 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
First-freeman_lex 1
Fails `crosses(9, 0)`, returning 36 instead of 0. More
5-liner: bit by bit-przemyslaw.daniel 2
Dictionary version :-) ```python def calkin_wilf(n: int) -> tuple[int, int]: result = {'1': 0, '0': 1} for bit in f"{n:b}": result[bit] = sum(result.values()) return tuple(result.values()) ``` More
Findt-StefanPochmann 1
I posted a [fixed(?) version](https://py.checkio.org/mission/frogs-collision/publications/StefanPochmann/python-3/fixed/share/4ab004d485da914baed376b1ffa0a6a1/), as this returns `0`, `0` and `-1` instead of `1`, `1` and `None`: ``` frog1 = 0, 0, 0, 0 frog2 = 0, 0, 0, 0 print(frogs_collision(frog1, More
[v3] 1-liner: count odd divisors (the naive way)-Phil15 1
What's the explanation for counting odd divisors? Without that, this isn't "clear" at all. More
1-liner: 59 chars-przemyslaw.daniel 1
Save two chars: ``` [x]+[0]*(x==0) [x,x][x!=0:] ``` More
Secomplex-StefanPochmann
Same as my first solution, but after seeing @veky's title saying complex. More
juestr's compressed-veky 1 1
8 chars less: ```python changing_direction=lambda e,p=lambda s:[aMore
2.7 times faster than built-in max-StefanPochmann
Benchmark results (executed on CheckiO): ``` 226 ns max 82 ns max_of_three 221 ns max 81 ns max_of_three 220 ns max 82 ns max_of_three ``` Benchmark code: ```python from time import perf_counter as time from itertools import repeat def max_of_three(a, b, c): return (a if a > c More
The Fastest-U.V
I can't reproduce your findings supporting that this is "The Fastest". Please share your benchmark results and your benchmark code. Here are mine: ``` 226 ns max 82 ns max_of_three 221 ns max 81 ns max_of_three 220 ns max 82 ns max_of_three ``` ```python from time import perf_counte More
Second-kazuki.h -1 1
We should have a "Tardy" category for highly inefficient solutions like this :-P More
1 line: map {}.setdefault -StefanPochmann
Two ways, can't decide which one I like better. Half of my old [LeetCode](https://leetcode.com/problems/isomorphic-strings/discuss/57892/1-liner-in-Python) solution for Isomorphic Strings. More
[see comments about authorship below]-veky 1
Memory of what? Of times when people didn't complain about PEP 8 violations and plagiarism? More
First-brownie57
`i + (i % 2 == 0)` is simply `i | 1`. More
5 versions-StefanPochmann
All just variations of the first solution, i.e., compare the first and last value of the current group and the new item. I was lazy typing, so `a` means first group value and `y`/`z` means last two group values (if `z` were included in the group). More
without sorting...-StefanPochmann
[Previously](https://py.checkio.org/mission/cipher-dict-decryption/publications/StefanPochmann/python-3/directions-please/share/6d032a971ac33cf1f3f252187039f79f/) I sorted. I believe it failed the tests without. If works now. Not sure what happened. I just saw Phil15's solution, which didn't sort, s More
Inside out-veky 1
Wtf... And you call **me** a "pairwise∘groupby freak"??? Let's see whether I can decipher this... More
Simpler Elephant-StefanPochmann
Another benchmark where I try to expose the reallocations by both ins the same list object over and over again but instead make copies and use each only once. Despite all my efforts the results aren't super reliable, though, I might have to try again when I have access to a more stable machine. ``` More
Simpler Elephant-StefanPochmann
Like my [original](https://py.checkio.org/mission/remove-all-after/publications/StefanPochmann/python-3/elephant-in-cairo-fast-all-rounder-with-benchmarks/share/2f2991cd6fa3280f7cf2bf62f0f6146b/) but simpler and might be faster. Here I temporarily *append* the border value instead of writing it into More
Elephant in Cairo - Fast all-rounder - With benchmarks-StefanPochmann 1
Previous solutions mainly fall into three camps, each with its own downside. This solution avoids all those downsides. - The [LBYL](https://docs.python.org/3/glossary.html#term-LBYL) solutions check `border in items` before calling `items.index(border)`. That double search becomes slow for long inpu More
creative slicing-juestr 1
I actually think this is better than returning the original `items`. Consistently returns a new list instead of sometimes the original list, which could be dangerous. More
1
2 3 4 5 6 7 8 9 10