38
StefanPochmann
16 38 54 Leader of the month
8978/ 9195
Last seen 14 hours 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
n % 6 == 4-veky 1
Hmm, the top of this page still says "Creative solution for Collatz Ztalloc", but apparently there are no Creative solutions anymore (see screenshot). What's going on? More
Beans for Breakfast 2-eraserhead88
`collatz_convert(1)` returns `''`, but `collatz_convert('')` returns not `1` but returns `None`. More
First-imloafer
Your `any([k=='u' and len(list(g)) >= 2 for k, g in groupby(data)])` is equivalent to just `'uu' in data`, isn't it? More
24-liner: fastest up to at least 10**10-przemyslaw.daniel 1
Why the special handling for `n < 9` instead of handling those cases like all others? More
Formulaic-veky 1
I think you could avoid the `+ 10**M` like I just did [here](https://py.checkio.org/mission/champernowne-word/publications/przemyslaw.daniel/python-3/24-liner-fastest-up-to-at-least-1010/share/bed7600900c0ee2539ac620cbc3e02eb/#comment-126535) in @przemyslaw.daniel's. (But maybe not worth it...) More
First-canassa
For "Diagonal reversed", you could've reversed upside down: `diagonal(matrix[::-1])))` instead of `diagonal(m[::-1] for m in matrix)))`. More
Simple O(sqrt),10**14 in 2.7 seconds-StefanPochmann 1
Think of 42 = 13+14+15 as 42 = (1+2+3) + 3\*12. Think of 42 = 9+10+11+12 as 42 = (1+2+3+4) + 4\*8. So go through the sums 1+...+n and test whether num - (1+...+n) is divisible by n. Instead of a sum variable, I just subtract from num directly. 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
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
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
Inside out-veky 1
Wtf... And you call **me** a "pairwise∘groupby freak"??? Let's see whether I can decipher this... 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
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
First-brownie57
`i + (i % 2 == 0)` is simply `i | 1`. 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
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
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
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
Secomplex-StefanPochmann
Same as my first solution, but after seeing @veky's title saying complex. 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 2 3 4 5
6
7 8 9 10