Refactor Day10 to simplify LINQ usage in GetButtonCombinations by removing unnecessary .Select()
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ public class Day10 : IPuzzleSolver<long>
|
|||||||
{
|
{
|
||||||
var buttonCombinations = GetButtonCombinations(joltages.Length, buttons)
|
var buttonCombinations = GetButtonCombinations(joltages.Length, buttons)
|
||||||
.GroupBy(x => x.Mask)
|
.GroupBy(x => x.Mask)
|
||||||
.ToDictionary(x => x.Key, x => x.Select(y => y).ToArray());
|
.ToDictionary(x => x.Key, x => x.ToArray());
|
||||||
var res = GetMinCountInternal(joltages, buttonCombinations, new Dictionary<int[], long>(new IntArrayEqualityComparer()));
|
var res = GetMinCountInternal(joltages, buttonCombinations, new Dictionary<int[], long>(new IntArrayEqualityComparer()));
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user