44
gyahun_dash
13 34 48
14278/ 15612
Last seen 5 months ago
Member for 10 years, 3 months, 4 days
Difficulty Normal
Best reviews / Newest reviews
Clearly separated islands-smilicic 1 1
You can use built-in function [complex](https://docs.python.org/3/library/functions.html#complex). More
combinations-gyahun_dash
inspired by [Sim0000’s solution](https://py.checkio.org/mission/largest-histogram/publications/Sim0000/python-3/first/). More
numpy.less-less-gyahun_dash
if numpy.less exists ([here](https://py.checkio.org/mission/short-string-conversion/publications/gyahun_dash/python-3/second/)) More
a bit ugly solution-eugene128736871 1
About line 9-12, if price//coin + length < shortest: return price // coin + length else: return shortest You can write as follows and delete if-else: return min(price // coin + length, shortest) More
memoized branch and bound-gyahun_dash 1
Benchmark (on my desktop PC): price, denoms -> answer name answer time[s] ... 123456 [1, 6, 7, 456, 678] -> 187 (appeared in test) gyahund 187 0.000000 lezeroq 187 0.187200 PioterM 187 0.280801 10249 [52, 64, 71, 101, 137, 217, 365, 502, 503, 51 More
First-e-l 1 1
What was your plan to use __q__? but now unused. More
Az-aziz199505 1 1
Line 10-12 are equivalent to: return max(found, key=len) More
re-gyahun_dash
Line 5: bins = [re.sub('(?P\d+)(\.)?', binarize, a) for a in adds] Line 8: pat = ','.join(['(?P\d+)\d*'] + ['\\1\d*'] * (len(adds) - 1)) More
First-gyahun_dash
[revised](http://www.checkio.org/mission/the-square-chest/publications/gyahun_dash/python-3/5th/) More
group-sequence-gyahun_dash
Solution by generating group-sequence: food | 1 | 2 3 4 | 5 6 7 8 9 10 | 11 12 ... sated(in func) | 0 | 0 1 2 | 0 1 2 3 4 5 | 0 1 ... sated pigeons | 1 | 1 2 3 | 3 3 3 4 5 6 | 6 6 ... More
Cardano-gyahun_dash 1
To get __time__, we solve the following cubic equation: time ** 3 + 3 * time ** 2 + 2 * time - 6 * food = 0 More
Second-gyahun_dash
string = '(x1,y1),(x2,y2),(x3,y3)' xsys = [[x1, x2, x3], [y1, y2, y3]] dxdy = [[x2 - x3, x3 - x1, x1 - x2], [y2 - y3, y3 - y1, y1 - y2]] More
Counter-gyahun_dash 1
Single cells are not linked with any other cells: stats[cell] == 0. So to delete them: cells &= set(stats) #### About stats: if stats[b] == 4, colony may be healthy. 0, 1, 0, 1, b, 1, 0, 1, 0, elif stats[b] == 3, colony containing b is not healthy. 0, 1, 0, 1, b, 1, More
Run Length with itertools-gyahun_dash 1 1
### Example: ((0, 0, 1, 0, 0), (0, 1, 1, 1, 0), (1, 1, 1, 1, 1), (0, 1, 1, 1, 0), (0, 0, 1, 0, 0)) First, we get horizontal and vertical RunLengths(horis and verts): ((0, 0, 1, 0, 0), # RL(length=1, y=0, x=2) (0, 1, 1, 1, 0), # RL(length=3, y=1, x=2) (1, 1, 1, More
namedtuple DP-gyahun_dash 1 2
length = max(map(len, strings)) if strings else 0 In Python 3.4, we can write: length = max(map(len, strings), default=0) More
super-gyahun_dash
> Connections can be repeated in the initial data, but inside it store once. I missed this sentence and modified my solution ([here](http://www.checkio.org/mission/friends/publications/gyahun_dash/python-3/list/?ordering=most_voted)). More
First-Sim0000 1 1
It's simple and clear. I've published a [solution](http://www.checkio.org/mission/dark-labyrinth/publications/gyahun_dash/python-3/second/) inspired by your solution. Thank you. More
First-seb.hoarau
def all_routes_from_node(m, node): possibilities = [] for arc in m: if node in arc: possibilities.append(arc) return possibilities How about using **list comprehension** here? def all_routes_from_node(m, node): return [arc fo More
Recursive solution-big312
if "1" in chemin and "2" in chemin and ... You can check **chemin** using **set**: if len(set(chemin)) == 8 and chemin[-1] == "1": ---- teleports_map = [(int(x), int(y)) for x, y in teleports_string.split(",")] You don't need to convert strings to **int**: teleports_map = telepo More
stack-blabaster 1
adjacent = [set() for _ in range(i)] How about **collections.defaultdict**? adjacent = defaultdict(set) More
1
2 3 4 5