diff --git a/d08/part1.py b/d08/part1.py new file mode 100644 index 0000000..8ed3d06 --- /dev/null +++ b/d08/part1.py @@ -0,0 +1,17 @@ +import sys +L = list(list(map(int,s)) for s in sys.stdin.read().splitlines()) +W = len(L[0]) ; H = len(L) +N=0 +for i in range(H): + for j in range(W): + v = L[i][j] + # look right + r = all(L[i][k]=v: + break + # look left + l = 0 + for k in range(j-1,-1,-1): + l+=1 + if L[i][k]>=v: + break + # look up + u = 0 + for k in range(i-1,-1,-1): + u+=1 + if L[k][j]>=v: + break + # look down + d = 0 + for k in range(i+1,H): + d += 1 + if L[k][j]>=v: + break + S = max(S,r*l*u*d) +print(S)