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
1 changed files with 2 additions and 3 deletions

View File

@ -23,9 +23,8 @@ public class Day10 : IPuzzleSolver<long>
.ToArray(); .ToArray();
var lamps = puzzleInput var lamps = puzzleInput
.Select(input => input.lamps) .Select(input => input.lamps)
.Select(lamps => lamps.Index()) .Select(lamps =>
.Select(ixlamps => lamps.Select(lamp => lamp == '#').ToArray())
ixlamps.Select(ixlamp => ixlamp.Item == '#').ToArray())
.ToArray(); .ToArray();
var buttons = puzzleInput var buttons = puzzleInput
.Select(input => input.buttons) .Select(input => input.buttons)