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
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
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
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
Using Regex-Eldin 1
It's simple and clear rather than puzzle. if matcher.match(data): return True else: return False You can modify the above to return the bool value directly: return matcher.match(data) More
DP-gyahun_dash
Brute Force version [here](http://www.checkio.org/mission/loading-cargo/publications/gyahun_dash/python-3/second/). More
First-Hide99 1
**string.ascii_uppercase** is helpful for your code. pair = [(chr(x), l.count(chr(x))) for x in range(ord('a'), ord('z')+1)] a = max(pair, key = lambda x:x[1]) You can use **l.count** in **lambda function** as follows. By doing so, you don't need to create the list of pairs. a More
Verify anagrams-OZMA
for i in word2: if i in word1: if word1.count(i) == word2.count(i): word1 = word1.replace(i, "") You don't need first **if** because second is False if i is not in word1(left=0, right>0). More
First-Hide99 1
cand = set(data) for c in cand: You can write as follows(del **cand**): for c in set(data): More
First-Hide99
pos = int(len(wrk)/2) You can use **//** instead of **int()**: pos = len(wrk) // 2 More
1 2 3 4
5