diff --git a/2020/src/bin/day17.rs b/2020/src/bin/day17.rs index fd12c1e..eae1ad5 100644 --- a/2020/src/bin/day17.rs +++ b/2020/src/bin/day17.rs @@ -1,5 +1,6 @@ #![feature(test)] extern crate test; +use itertools::Itertools; use aoc2020::{ common::*, grid::{cell::Cell, *} }; @@ -26,6 +27,7 @@ fn make_step(input: Grid) -> Grid { .fields .keys() .flat_map(|p| p.neighbors()) + .unique() .map(|pos| { let cell = readonly.get(&pos); let new = match (&cell, count_live_neighbors(&pos, &readonly)) {