day(11): format the expression
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
bcdea3496b
commit
63d495b175
1 changed files with 6 additions and 1 deletions
|
@ -34,7 +34,12 @@ impl Day11 {
|
||||||
let min_x = min(x0, x1);
|
let min_x = min(x0, x1);
|
||||||
let max_x = max(x0, x1);
|
let max_x = max(x0, x1);
|
||||||
|
|
||||||
xd += to_add * self.empty_xs.iter().filter(|&&x| min_x < x && x < max_x).count();
|
xd += to_add
|
||||||
|
* self
|
||||||
|
.empty_xs
|
||||||
|
.iter()
|
||||||
|
.filter(|&&x| min_x < x && x < max_x)
|
||||||
|
.count();
|
||||||
yd += to_add * self.empty_ys.iter().filter(|&&y| y0 < y && y < y1).count();
|
yd += to_add * self.empty_ys.iter().filter(|&&y| y0 < y && y < y1).count();
|
||||||
|
|
||||||
xd + yd
|
xd + yd
|
||||||
|
|
Loading…
Reference in a new issue