blob: c5889e2ce6db925f8ac52cdf50c1d59714f35e5f (
plain) (
blame)
1
2
3
4
5
6
7
8
|
import numpy as np
from scipy.ndimage import label
with open("day14regions.txt") as regions:
hash = np.array([list(map(int, line.strip())) for line in regions])
_, num_features = label(hash)
print(num_features)
|