Fix Day02 travel distance calculation to require complete windows
This commit is contained in:
1 parent
9907908381
commit
b94ab07924
1 file changed
+1
-1
+1
-1
@@ -34,7 +34,7 @@ public class Day02 : IPuzzleSolver<long>
|
|||||||
.Prepend(waypoint)
|
.Prepend(waypoint)
|
||||||
.SlidingWindow(2)
|
.SlidingWindow(2)
|
||||||
.Aggregate(0, (acc, next) =>
|
.Aggregate(0, (acc, next) =>
|
||||||
next.Length < 2
|
next.Length != 2
|
||||||
? acc
|
? acc
|
||||||
: acc + GetDistance(next[0], next[1]));
|
: acc + GetDistance(next[0], next[1]));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user