38
Awesome Team
Stefan Pochmann
http://www.stefan-pochmann.info/
Last seen 26 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?
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
Inspired by [coells' "max"](http://www.checkio.org/mission/gcd/publications/coells/python-3/max/)
More
Seriously, I didn't like any of the ways I've seen here to avoid code duplication. They just made things complicated.
More
I haven't watched those movies but I suspect that that's how they work anyway.
More
Still basically [ale1ster's solution](http://www.checkio.org/mission/digits-doublets/publications/ale1ster/python-3/simple-bfs/) but I changed it a bit (and yes, used short names, N=numbers, P=paths).
More
I rewrote it a bit now, [see here](http://www.checkio.org/mission/digits-doublets/publications/StefanPochmann/python-3/modified-ale1ster/). Do you still recognize it? :-)
More
Fascinating. I thought this might not lead to optimal paths, because `for z in d` might be an unlucky order. But apparently you get away with it due to how Python is implemented (at least the one on my PC). Were you aware of that?
More
Alternatively, and one char shorter:
checkio=c=lambda a,b,m=1:a and b and((a|b)%2+c(a,b/2,0))*2+(m and c(a/2,b))
Or without extra parameter:
checkio=c=lambda a,b:a and b and((-a|b)%2+c(-abs(a),b/2))*2+(a>0and c(a/2,b))
More
[veky's solution](http://www.checkio.org/mission/solution-for-anything/publications/veky/python-27/1line/) + [DiZ's solution](http://www.checkio.org/mission/solution-for-anything/publications/DiZ/python-3/shortest/) + **dir**ty trick by me.
More
Not shortest anymore, but [I used](http://www.checkio.org/mission/solution-for-anything/publications/StefanPochmann/python-3/veky-diz-stefan/) your ideas, thanks :-)
More
Based on [takapt0226's solution](http://www.checkio.org/mission/loading-cargo/publications/takapt0226/python-3/first/).
More
Fun but super slow. Without preparing sum(data), the tests didn't even seem to finish at all.
More
Without the inner list and double min:
checkio = lambda data: min(abs(sum(step[:cut])-sum(step[cut:]))
for step in permutations(data) for cut in range(len(step)))
More
Didn't find a pangram doc string, unfortunately. But this is almost fully correct - that string is only missing 'k' and 'q'. I could have used `dict` (that's only missing 'q') or `enumerate` (missing just 'k'), but they're longer and `int` does the job already. Who needs 'k' and 'q' anyway.
More
Golfer:
check_pangram = lambda t: all(map(t.lower().__contains__, string.lowercase))
And of course you don't need all those spaces.
More
`a` and `b` keep track of the best sums up until the previous two steps. [More readable version](http://www.checkio.org/mission/stair-steps/publications/StefanPochmann/python-3/short-simple-efficient-clear/).
More