feat: solve day 7 part 1 and part 2

This commit is contained in:
Stevan Freeborn
2024-12-07 19:59:44 -06:00
parent 7f4f514b8c
commit 8f7f617182
7 changed files with 268 additions and 2 deletions
+6 -2
View File
@@ -1,5 +1,7 @@
using System.Diagnostics;
using BridgeRepair;
if (args.Length is 0)
{
Console.WriteLine("Please provide a path to the input file.");
@@ -18,7 +20,9 @@ var input = await File.ReadAllLinesAsync(args[0]);
var stopwatch = new Stopwatch();
stopwatch.Start();
// TODO: Implement solution
var result = new PuzzleParser().Parse(input)
.Where(e => e.IsPossible(isPart2))
.Sum(e => e.TestValue);
stopwatch.Stop();
Console.WriteLine($". ({stopwatch.ElapsedMilliseconds}ms)");
Console.WriteLine($"The sum of the test value for possible equations is {result}. ({stopwatch.ElapsedMilliseconds}ms)");