38
StefanPochmann
16 38 54 Leader of the month
8978/ 9195
Last seen 4 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
Short, Simple, Efficient, Clear-StefanPochmann 1
`a` and `b` keep track of the best sums up until the previous two steps. [One-liner version](http://www.checkio.org/mission/stair-steps/publications/StefanPochmann/python-3/short-simple-efficient/). More
chi-veky 1
`chi` is nice. But what does the name mean here? I don't see a reason why this wouldn't work for other sizes (as long as it's small enough to be fast enough). More
Permutations (6 lines)-StefanPochmann
(ok 8 lines but I could easily `__import__`) More
Short, Simple, Speedy-StefanPochmann 1
"Speedy" as in I get it after just one guess. I challenge you to find two expressions which are *not* equivalent but which my x,y pair fails to distinguish. More
125-StefanPochmann 2
125 is the file size in bytes. It's 127 with double spaces instead of tabs. Here's another 127: def total_cost(C): M={} for c in C:M[c[:10]]=M.get(c[:10],0)-(-int(c[20:])/60) return sum(m+max(0,m-100)for m in M.values()) More
Recursive Cycle, Short-StefanPochmann 1
Credit to @jimako1989 for his `all([x+y>z,y+z>x,z+x>y])` which I just shortened to my `a+b>c>b-a>-c`. More
82-StefanPochmann
Alternatively (same length): checkio=C=lambda c,n,s='',i=0:s*(i==n*2)or C(c,n,s+','*(i>i%min(c,n)<1)+`i%n`,i+1) More
Second-coells 1
Wow, this is great. But... what technique is that? More
64, using reduce-StefanPochmann
Same as [this](http://www.checkio.org/mission/stair-steps/publications/StefanPochmann/python-3/short-simple-efficient-clear/). More
Can't be bothered...-StefanPochmann
... to write a regex distinguishing the two styles. More
code reuse ftw-StefanPochmann 1
Just reusing [my solution to the original mission](https://py.checkio.org/mission/roman-numerals/publications/StefanPochmann/python-3/short-and-clear/). I could write it as reverse_roman = list(map(checkio, range(4000))).index but then I'd have to write it *below* the `checkio` function :-( More
Small-StefanPochmann
Apparently the judge doesn't even care whether I return the intervals as tuples or lists... More
50 (based on przemyslaw.daniel's 62 and artakase's 59)-StefanPochmann 1
Apparently the judge doesn't care whether I actually return a `bool`. Here's a 53 that does: checkio=lambda p:p[9:7+len({ord(x)>>5for x in p})]>'' And here's a 54 based just on przemyslaw.daniel's: checkio=lambda p:len(p)-7>2>5for x in p}) @przemyslaw.daniel's 62 is [here](h More
Small-StefanPochmann
A variation, one character shorter and perhaps a little nicer/faster: def merge_intervals(intervals): r, E = [], float('-inf') for s, e in intervals: if s > E + 1: r += [s, e], E = r[-1][1] = max(E, e) return r More
Simple solution-cs1g
Pretty inefficient with all those `intervals.pop(0)`. More
[old] oneliner, should be O(n)-StefanPochmann 1
This should be O(n) because the `sorted` shouldn't be necessary. It only is because the judge currently wants the output intervals in a certain order (even though the problem specification doesn't require that). Already reported this judge bug... More
simple oneliner, should be O(n) (see comments)-StefanPochmann
The actual creation of the intervals only takes O(n) time, but the required sorting makes it only O(n log n). Makes me sad :-( Could use `range(start, start+len(data))` instead of `count(start)` if I wanted to avoid the import, but `count(start)` is much nicer and faster. A golfed version (would b More
First-Kajin
Um... how do you think `start - data[index] == 1` or `start -data[index] > 1` can ever be true? More
a and b-firexd2
What's the point of explicitly creating those two temporary extra lists in the first line? `sorted` is perfectly happy with getting a `set` and it already returns a `list`. More
First-k-nakamura
Reversing `data` seems like an attempt to make it fast, but it's still only O(n^2) because of the repetition of the expensive line 13. A little experimental confirmation, doubling the input size roughly quadruples the time (I removed your `print` line for this): ``` >>> from timeit import timeit >> More
1 2 3 4 5 6 7
8
9 10