|
|
@@ -2,13 +2,12 @@ import os, argparse
|
|
|
import numpy as np
|
|
|
|
|
|
def solve_task(lines):
|
|
|
- trees = np.array([[int(c)] for c in lines])
|
|
|
+ trees = np.array([[int(c) for c in line] for line in lines])
|
|
|
visible = np.zeros((len(trees), len(trees[0])))
|
|
|
- print(visible)
|
|
|
- check_visibility_from_left(trees, visible)
|
|
|
- print(visible)
|
|
|
- check_visibility_from_left(np.rot90(trees, 1), np.rot90(visible, 1))
|
|
|
- print(visible)
|
|
|
+ #print(visible)
|
|
|
+ for r in range(4):
|
|
|
+ check_visibility_from_left(np.rot90(trees, r), np.rot90(visible, r))
|
|
|
+ print(np.sum(visible))
|
|
|
|
|
|
def flip_y(trees):
|
|
|
return [reversed(line) for line in trees]
|