Completed day 3

This commit is contained in:
Rob Stoffelen 2024-12-03 08:56:57 +01:00
parent 9e3c218ffe
commit 163f1fe4f3
4 changed files with 7 additions and 10 deletions

View File

@ -10,7 +10,7 @@ IChallange challange = Host.CreateDefaultBuilder()
.Build()
.Services
.GetService<SolutionManager>()
.GetChallange(2024, 2);
.GetChallange(2024, 3);
Console.WriteLine($"Part 1: {await challange.GetSolutionPart1()}");

View File

@ -1,6 +1,4 @@
using AdventOfCode.Core.Shared.IO;
using System;
using System.Reflection;
namespace AdventOfCode.Solutions._2024
{
@ -28,7 +26,8 @@ namespace AdventOfCode.Solutions._2024
//4
//301
public async Task<string> GetSolutionPart2() => (await _inputReader.ReadAsArrayString())
public async Task<string> GetSolutionPart2()
=> (await _inputReader.ReadAsArrayString())
.Select(ParselineToReports)
.Where(reports => AreReportsSave(reports, true))
.Count()

View File

@ -34,6 +34,9 @@
<Compile Update="2023\Day 13\Day13.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
<Compile Update="2024\Day 03\Day03.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
<Compile Update="2024\Day 02\Day02.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>

View File

@ -1,6 +1 @@
7 6 4 2 1
1 2 7 8 9
9 7 6 2 1
1 3 2 4 5
8 6 4 4 1
1 3 6 7 9
xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))