1 """Find the dangerous vents"""
4 vent_field = np.zeros((1000, 1000))
6 with open("5_input.txt") as f:
8 p1, p2 = line.split("->")
9 x1, y1, x2, y2 = [int(x) for x in p1.split(",") + p2.split(",")]
12 for y in range(min(y1, y2), max(y1, y2) + 1):
13 vent_field[x1][y] += 1
15 for x in range(min(x1, x2), max(x1, x2) + 1):
16 vent_field[x][y1] += 1
18 print(len(np.argwhere(vent_field > 1)))