diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-04 07:09:10 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-04 07:09:10 +0100 |
| commit | a8df3112a2378aa62ea920f3d202204fc019ad19 (patch) | |
| tree | de5798dec1af3c277f6585f4b8cf5adf1bc46982 /solutions/py/03-1.py | |
| parent | 831755fdc6d430bd8781da1897270cf2934bc858 (diff) | |
| download | aoc-a8df3112a2378aa62ea920f3d202204fc019ad19.tar.gz | |
Cleanup
Diffstat (limited to 'solutions/py/03-1.py')
| -rw-r--r-- | solutions/py/03-1.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/solutions/py/03-1.py b/solutions/py/03-1.py index dea1c05..3f26a84 100644 --- a/solutions/py/03-1.py +++ b/solutions/py/03-1.py @@ -1,14 +1,11 @@ import math - def intersection(l1, l2): - tmp = set(l1) - return [value for value in l2 if value in tmp] + return [value for value in l2 if value in l1] def man_dist(point): return abs(point[0]) + abs(point[1]) - wire1 = [] wire2 = [] for wire in (wire1, wire2): @@ -34,7 +31,6 @@ for wire in (wire1, wire2): y += dy wire.append((x, y)) points = intersection(wire1, wire2) -print(len(points)) dist = man_dist(points[0]) for point in points[1:]: dist = min(dist, man_dist(point)) |
