Update day 12 solution
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Save some ms
This commit is contained in:
@@ -16,7 +16,7 @@ def process_node(node, available_edges, visited):
|
||||
nxt = process_node(n, available_edges, visited)
|
||||
for p in nxt:
|
||||
p.appendleft(node)
|
||||
paths.append(p)
|
||||
paths += nxt
|
||||
if node in visited:
|
||||
visited.remove(node)
|
||||
return paths
|
||||
@@ -40,7 +40,7 @@ def process_node_twice(node, available_edges, visited, visited_twice):
|
||||
nxt = process_node_twice(n, available_edges, visited, visited_twice)
|
||||
for p in nxt:
|
||||
p.appendleft(node)
|
||||
paths.append(p)
|
||||
paths += nxt
|
||||
if visited_twice == node:
|
||||
visited_twice = None
|
||||
elif node in visited:
|
||||
|
||||
Reference in New Issue
Block a user