diff options
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)) |
