Skip to content

Commit 6a0eda6

Browse files
committed
[day8b] Skip edges
1 parent f3b00e6 commit 6a0eda6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

day8b/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ fn main() {
1414
println!("{}", map
1515
.iter()
1616
.enumerate()
17-
.flat_map(|(y, row)| row.iter().enumerate().map(move |(x, &height)| (y, x, height)))
17+
.skip(1)
18+
.take(height - 2)
19+
.flat_map(|(y, row)| row.iter().enumerate().skip(1).take(width - 2).map(move |(x, &height)| (y, x, height)))
1820
.map(|(y, x, tree_height)| {
1921
let score = [
2022
(-1, 0),

0 commit comments

Comments
 (0)