Refactor Day12 to simplify LINQ usage in GetMinTotalPresentArea by replacing .Select() with .Zip()
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ public class Day12 : IPuzzleSolver<long>
|
||||
private int GetMinTotalPresentArea(int[] presentCounts, int[] presentSizes)
|
||||
{
|
||||
return presentCounts
|
||||
.Select((presentCount, index) => presentCount * presentSizes[index])
|
||||
.Zip(presentSizes, (count, size) => count * size)
|
||||
.Sum();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user