Fix Day02 travel distance calculation to require complete windows

This commit is contained in:
Sebastian Lindemeier committed 2026-12-02 10:27:00 +01:00
1 parent 9907908381
commit b94ab07924
1 file changed
+1 -1
+1 -1
View File
@@ -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]));
} }