ben
/
aoc
1
0
Fork 0

lol visual studio and rider don't like collection initializers yet
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Ben Harris 2023-12-01 01:04:11 -05:00
parent ce3334832f
commit 58af58ecd7
1 changed files with 3 additions and 5 deletions

View File

@ -12,11 +12,10 @@ public class Day01() : Day(2023, 1, "Puzzle Name")
public override object Part1() =>
Input.Sum(line => (line.First(char.IsDigit) - '0') * 10 + (line.Last(char.IsDigit) - '0'));
public override object Part2()
{
return Input.Sum(line =>
public override object Part2() =>
Input.Sum(line =>
{
List<int> digits = new();
List<int> digits = [];
for (var i = 0; i < line.Length; i++)
{
@ -38,5 +37,4 @@ public class Day01() : Day(2023, 1, "Puzzle Name")
return digits.First() * 10 + digits.Last();
});
}
}