Implemented Day03 part1 and part2 for 2026

This commit is contained in:
Sebastian Lindemeier committed 2026-12-03 09:27:39 +01:00
1 parent b94ab07924
commit 3510234ed8
3 files changed
+179 -4

No files matched your search

+2 -4
View File
@@ -33,10 +33,8 @@ public class Day02 : IPuzzleSolver<long>
return program
.Prepend(waypoint)
.SlidingWindow(2)
.Aggregate(0, (acc, next) =>
next.Length != 2
? acc
: acc + GetDistance(next[0], next[1]));
.Skip(1)
.Aggregate(0, (acc, next) => acc + GetDistance(next[0], next[1]));
}
private static int GetDistance(char current, char next)