Skip to content

Commit 4367b17

Browse files
committed
Edit solution
1 parent 8755fb1 commit 4367b17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

2024/day20/solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
q.append(p + dp)
2727

2828
pt1, pt2 = 0, 0
29-
for p1, p2 in combinations(times.keys(), 2):
29+
for (p1, t1), (p2, t2) in combinations(times.items(), 2):
3030
dist = abs(p1.real - p2.real) + abs(p1.imag - p2.imag)
3131
if dist <= 2:
32-
pt1 += (times[end] - (times[p1] + times[end] - times[p2] + dist) >= 100)
32+
pt1 += (times[end] - (t1 + times[end] - t2 + dist) >= 100)
3333
if dist <= 20:
34-
pt2 += (times[end] - (times[p1] + times[end] - times[p2] + dist) >= 100)
34+
pt2 += (times[end] - (t1 + times[end] - t2 + dist) >= 100)
3535

3636
print(pt1, pt2)

0 commit comments

Comments
 (0)