Skip to content

Commit edafffb

Browse files
committed
Add day 20
1 parent 886ac37 commit edafffb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

2024/20/20.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
G.add_edge(c, c+d)
1010

1111
S = [c for c in coords if coords[c] in 'S'][0]
12-
coord_to_dist = nx.shortest_path_length(G, source=S).items()
12+
coord_to_dist = nx.shortest_path_length(G, S).items()
1313

1414
s1 = s2 = 0
1515
for c1, dist1 in coord_to_dist:
@@ -19,5 +19,4 @@
1919
s1 += diff <= 2
2020
s2 += diff <= 20
2121

22-
print(s1)
23-
print(s2)
22+
print(s1, s2, sep="\n") # use pypy instead of python

0 commit comments

Comments
 (0)