1 """Find where smoke settles"""
5 with open("9_input.txt") as f:
7 heights.append([int(char) for char in line.strip()])
10 n_cols = len(heights[0])
14 for i in range(n_rows):
15 for j in range(n_cols):
18 heights[i - 1][j] if i != 0 else 10,
19 heights[i][j - 1] if j != 0 else 10,
20 10 if i == n_rows - 1 else heights[i + 1][j],
21 10 if j == n_cols - 1 else heights[i][j + 1],
23 if val < min(to_compare):
25 mins_coords.append((i, j))
28 for minimum in mins_coords:
29 to_walk = set(minimum)
34 orth_coords = [(i - 1, j), (i, j - 1), (i + 1, j), (i, j + 1)]
35 for x, y in orth_coords:
37 if (x >= 0 and y >= 0 and heights[x][y] != 9 and
38 (x, y) not in walked):