38
Awesome Team
Stefan Pochmann
http://www.stefan-pochmann.info/
Last seen 25 minutes ago
Member for 9 years, 1 month, 21 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?
Hmm... how did you get that here? The function name is wrong, the return type is wrong, and I just tried it and it does get rejected.
Edit: Ah, [I see](https://py.checkio.org/forum/post/12041/new-mission-the-highest-building/) that was apparently the original format. Does CheckiO not rejudge soluti
More
This one is one char longer, but equally long in Python 3 because it only has one division:
checkio=c=lambda a,b:a and[2*b,2**~-len(bin(b))-2][a%2]+c(a/2,b)
More
Got a [shorter one](http://www.checkio.org/mission/multiplication-table/publications/StefanPochmann/python-27/shorter-than-htamas/). Recursion ftw! Btw, I saw your nice Google Code Jam solutions recently, then googled you, and that's how I found CheckIO. Which I now like a lot. So thanks :-)
More
Just a variation...
long_repeat=lambda l:max(map(len,__import__('re').split(r'((.)\2*)',l)))
More
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
Very nice! Just three things:
1. You could say `'SENW'` instead of `['S','E','N','W']`.
2. The `or ''` is useless.
3. You could use `x==y==10`.
More
You [reinventor](https://github.com/python/cpython/blob/de7a2f04d6b9427d568fcb43b6f512f9b4c4bd84/Objects/listobject.c#L2306-L2314) :-)
More
I'd say removing less than nothing shouldn't remove *everything*, like this does for `remove_min_max({1, 2, 3}, -1)`.
More
Inspired by yours:
def remove_min_max(data: set, total: int) -> set:
for extremum in [min, max] * total:
data.discard(extremum(data, default=None))
return data
More
You could use
result += (data[0], data[size]),
which is one character shorter and probably slightly faster. Well I guess in an O(n^2) solution you don't care about efficiency much :-P. But this is always a great way to confuse/educate people :-D
More
How about...
def merged(intervals):
if intervals:
it = iter(intervals)
a, b = next(it)
...
More
Explanation: For each center cell c, go through all cells and count the bacteria at each Manhattan distance. Then use that to find the smallest non-full "ring" around it and if that ring is empty, we found the radius of the colony.
It's not efficient, but it is simple (and it doesn't have to be eff
More
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
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
[You're a bit late](https://py.checkio.org/mission/monkey-typing/publications/StefanPochmann/python-3/sum-map-__contains__/) :-P
More