diff --git a/d08/part1.py b/d08/part1.py index 8ed3d06..0bdafe1 100644 --- a/d08/part1.py +++ b/d08/part1.py @@ -1,7 +1,8 @@ import sys L = list(list(map(int,s)) for s in sys.stdin.read().splitlines()) W = len(L[0]) ; H = len(L) -N=0 +N = 0 +Q = 0 for i in range(H): for j in range(W): v = L[i][j] @@ -14,4 +15,5 @@ for i in range(H): # look down d = all(L[k][j] h: + V[r * W + c] = True + h = L[r][c] + Q += 1 + +V = [False for _ in range(size)] +for r in range(H): + check([r], range(W)) + check([r], range(W-1, -1, -1)) +for c in range(W): + check(range(H), [c]) + check(range(H-1, -1, -1), [c]) +print(sum(V), 2*(H*W+W*H), Q) \ No newline at end of file