Refactor Day10 to simplify lamp parsing by removing redundant .Index() call and unnecessary LINQ chain

This commit is contained in:
Sebastian Lindemeier
2025-12-15 10:28:06 +01:00
parent 0359bacf47
commit ee061757a8
+2 -3
View File
@@ -23,9 +23,8 @@ public class Day10 : IPuzzleSolver<long>
.ToArray();
var lamps = puzzleInput
.Select(input => input.lamps)
.Select(lamps => lamps.Index())
.Select(ixlamps =>
ixlamps.Select(ixlamp => ixlamp.Item == '#').ToArray())
.Select(lamps =>
lamps.Select(lamp => lamp == '#').ToArray())
.ToArray();
var buttons = puzzleInput
.Select(input => input.buttons)