diff --git a/AdvendOfCode.Runner/Program.cs b/AdvendOfCode.Runner/Program.cs index 13db545..2f29638 100644 --- a/AdvendOfCode.Runner/Program.cs +++ b/AdvendOfCode.Runner/Program.cs @@ -10,7 +10,7 @@ IChallange challange = Host.CreateDefaultBuilder() .Build() .Services .GetService() - .GetChallange(2024, 4); + .GetChallange(2024, 5); Console.WriteLine($"Part 1: {await challange.GetSolutionPart1()}"); diff --git a/AdventOfCode.Solutions/2024/Day 04/Day04.cs b/AdventOfCode.Solutions/2024/Day 04/Day04.cs index 4a1d5b2..e8d833b 100644 --- a/AdventOfCode.Solutions/2024/Day 04/Day04.cs +++ b/AdventOfCode.Solutions/2024/Day 04/Day04.cs @@ -33,7 +33,6 @@ namespace AdventOfCode.Solutions._2024 //1888 public async Task GetSolutionPart2() { - //_inputReader.SetSampleInput(true); Grid grid = await _inputReader.ReadToGrid(); int total = grid.FindWithValue('M').Where(p => IsValid(grid, p, 'S')).Count(); total += grid.FindWithValue('S').Where(p => IsValid(grid, p, 'M')).Count(); diff --git a/AdventOfCode.Solutions/2024/Day 05/Day05.cs b/AdventOfCode.Solutions/2024/Day 05/Day05.cs new file mode 100644 index 0000000..4af6713 --- /dev/null +++ b/AdventOfCode.Solutions/2024/Day 05/Day05.cs @@ -0,0 +1,119 @@ +using AdventOfCode.Core.Shared.IO; + +namespace AdventOfCode.Solutions._2024 +{ + public class Day05 : IChallange + { + public int Year => 2024; + + public int Day => 5; + + private readonly IInputReader _inputReader; + + public Day05(IInputReader inputReader) + { + _inputReader = inputReader; + _inputReader.SetInput(this); + } + + // 143 + // 5651 + public async Task GetSolutionPart1() + { + int total = 0; + await foreach ((Rule[] rules, int[] updates) in GetUpdateWithRules(true)) + { + total += updates[(updates.Length - 1) / 2]; + } + + return total.ToString(); + } + + // 123 + // 4743 + public async Task GetSolutionPart2() + { + int total = 0; + await foreach ((Rule[] rules, int[] updates) in GetUpdateWithRules(false)) + { + Rule[] requiredRules = rules; + int A = 0, + runs = (updates.Length + 1) / 2; + + for (int run = 0; run < runs; run++) + { + int[] B = requiredRules.Select(r => r.B).Distinct().ToArray(); + A = requiredRules.Where(r => !B.Contains(r.A)).Select(r => r.A).First(); + requiredRules = requiredRules.Where(r => r.A != A).ToArray(); + } + + total += A; + } + + return total.ToString(); + } + + private struct Rule + { + public int A { get; set; } + public int B { get; set; } + } + + private async IAsyncEnumerable<(Rule[] rules, int[] updates)> GetUpdateWithRules(bool returnValidSet = true) + { + List rules = []; + bool inputComplete = false; + await foreach (string updateString in _inputReader.ReadAsStringLine()) + { + if (!inputComplete) + { + if (string.IsNullOrEmpty(updateString)) + inputComplete = true; + else + rules.Add(ParseRule(updateString)); + continue; + } + + int[] updatePages = updateString.Split(',').Select(int.Parse).ToArray(); + Rule[] requiredRules = rules + .Where(r => updatePages.Contains(r.A)) + .Where(r => updatePages.Contains(r.B)) + .ToArray(); + + if (IsValid(requiredRules, updatePages) == returnValidSet) + { + yield return (requiredRules, updatePages); + } + } + } + + private static bool IsValid(Rule[] rules, int[] updates) + { + Rule[] requiredRules = rules; + List openRules = []; + foreach (int update in updates) + { + // check if the current update is in the required list as the second value, if so this is an invalid update + if (requiredRules.Any(r => r.B == update)) + { + return false; + } + + // get new rules + openRules.AddRange(requiredRules.Where(r => r.A == update)); + requiredRules = requiredRules.Where(r => r.A != update).ToArray(); + + // close open rules + openRules = openRules.Where(r => r.B != update).ToList(); + } + + return true; + } + + private static Rule ParseRule(string input) + { + int[] numbers = input.Split('|').Select(int.Parse).ToArray(); + return new Rule { A = numbers[0], B = numbers[1] }; + } + } +} \ No newline at end of file diff --git a/AdventOfCode.Solutions/2024/Day 05/day-05-input.txt b/AdventOfCode.Solutions/2024/Day 05/day-05-input.txt new file mode 100644 index 0000000..757dfa8 --- /dev/null +++ b/AdventOfCode.Solutions/2024/Day 05/day-05-input.txt @@ -0,0 +1,1373 @@ +35|97 +77|66 +77|86 +72|16 +72|79 +72|38 +13|38 +13|31 +13|65 +13|15 +31|47 +31|46 +31|61 +31|71 +31|96 +28|55 +28|11 +28|66 +28|47 +28|45 +28|12 +66|69 +66|64 +66|71 +66|46 +66|93 +66|13 +66|65 +85|21 +85|58 +85|79 +85|18 +85|86 +85|36 +85|16 +85|39 +29|64 +29|11 +29|79 +29|81 +29|38 +29|28 +29|67 +29|42 +29|36 +12|29 +12|71 +12|36 +12|85 +12|87 +12|79 +12|22 +12|93 +12|26 +12|16 +61|18 +61|29 +61|42 +61|21 +61|78 +61|67 +61|46 +61|13 +61|91 +61|71 +61|96 +58|48 +58|91 +58|94 +58|55 +58|32 +58|46 +58|78 +58|45 +58|47 +58|51 +58|39 +58|96 +55|78 +55|24 +55|42 +55|54 +55|46 +55|67 +55|38 +55|64 +55|26 +55|65 +55|71 +55|69 +55|35 +79|15 +79|45 +79|61 +79|37 +79|32 +79|31 +79|73 +79|58 +79|36 +79|48 +79|28 +79|81 +79|18 +79|39 +46|13 +46|78 +46|87 +46|29 +46|97 +46|91 +46|16 +46|72 +46|22 +46|38 +46|96 +46|64 +46|65 +46|67 +46|69 +47|69 +47|37 +47|46 +47|24 +47|29 +47|71 +47|94 +47|39 +47|55 +47|45 +47|61 +47|54 +47|96 +47|13 +47|26 +47|67 +73|87 +73|22 +73|94 +73|48 +73|39 +73|46 +73|86 +73|69 +73|24 +73|78 +73|21 +73|66 +73|26 +73|47 +73|12 +73|61 +73|18 +42|15 +42|86 +42|36 +42|32 +42|35 +42|11 +42|16 +42|79 +42|64 +42|81 +42|93 +42|48 +42|97 +42|65 +42|85 +42|77 +42|38 +42|72 +51|55 +51|26 +51|91 +51|32 +51|45 +51|46 +51|61 +51|47 +51|66 +51|21 +51|71 +51|96 +51|39 +51|73 +51|69 +51|18 +51|86 +51|94 +51|37 +39|66 +39|35 +39|46 +39|55 +39|69 +39|78 +39|67 +39|93 +39|72 +39|13 +39|71 +39|38 +39|91 +39|54 +39|12 +39|45 +39|96 +39|42 +39|22 +39|24 +36|66 +36|94 +36|21 +36|78 +36|28 +36|18 +36|45 +36|46 +36|81 +36|37 +36|73 +36|51 +36|86 +36|61 +36|11 +36|47 +36|77 +36|32 +36|48 +36|58 +36|39 +78|85 +78|69 +78|13 +78|42 +78|87 +78|72 +78|96 +78|24 +78|12 +78|16 +78|64 +78|22 +78|71 +78|26 +78|65 +78|29 +78|97 +78|35 +78|54 +78|91 +78|79 +78|93 +96|87 +96|13 +96|38 +96|79 +96|29 +96|54 +96|69 +96|35 +96|28 +96|64 +96|97 +96|65 +96|22 +96|36 +96|67 +96|26 +96|24 +96|42 +96|81 +96|16 +96|72 +96|71 +96|85 +11|45 +11|51 +11|61 +11|55 +11|32 +11|69 +11|66 +11|87 +11|78 +11|48 +11|47 +11|94 +11|46 +11|71 +11|96 +11|26 +11|12 +11|18 +11|73 +11|86 +11|91 +11|39 +11|37 +11|21 +81|73 +81|91 +81|15 +81|46 +81|47 +81|45 +81|11 +81|18 +81|31 +81|86 +81|94 +81|77 +81|21 +81|55 +81|58 +81|48 +81|78 +81|28 +81|37 +81|66 +81|51 +81|61 +81|39 +81|32 +21|91 +21|71 +21|45 +21|24 +21|64 +21|42 +21|66 +21|22 +21|29 +21|18 +21|37 +21|55 +21|69 +21|67 +21|54 +21|39 +21|87 +21|12 +21|72 +21|78 +21|13 +21|26 +21|96 +21|46 +87|13 +87|29 +87|85 +87|28 +87|67 +87|65 +87|16 +87|35 +87|69 +87|77 +87|38 +87|97 +87|36 +87|64 +87|81 +87|71 +87|54 +87|58 +87|24 +87|93 +87|79 +87|42 +87|22 +87|72 +69|16 +69|15 +69|29 +69|67 +69|24 +69|77 +69|13 +69|38 +69|64 +69|72 +69|36 +69|54 +69|79 +69|65 +69|31 +69|85 +69|42 +69|28 +69|81 +69|97 +69|58 +69|22 +69|35 +69|93 +26|81 +26|24 +26|69 +26|35 +26|72 +26|16 +26|38 +26|29 +26|54 +26|58 +26|79 +26|71 +26|13 +26|28 +26|93 +26|65 +26|87 +26|97 +26|64 +26|36 +26|85 +26|42 +26|67 +26|22 +65|16 +65|85 +65|51 +65|11 +65|61 +65|81 +65|58 +65|48 +65|97 +65|37 +65|77 +65|79 +65|15 +65|94 +65|36 +65|18 +65|31 +65|39 +65|32 +65|86 +65|21 +65|28 +65|47 +65|73 +16|36 +16|66 +16|18 +16|81 +16|79 +16|77 +16|47 +16|37 +16|58 +16|28 +16|86 +16|55 +16|94 +16|39 +16|32 +16|11 +16|21 +16|61 +16|45 +16|51 +16|31 +16|73 +16|48 +16|15 +86|66 +86|78 +86|26 +86|54 +86|32 +86|48 +86|96 +86|47 +86|22 +86|12 +86|87 +86|61 +86|37 +86|46 +86|71 +86|45 +86|39 +86|91 +86|21 +86|69 +86|94 +86|18 +86|24 +86|55 +67|79 +67|64 +67|51 +67|42 +67|11 +67|93 +67|16 +67|58 +67|15 +67|81 +67|48 +67|72 +67|38 +67|28 +67|65 +67|86 +67|73 +67|36 +67|77 +67|85 +67|31 +67|32 +67|97 +67|35 +37|39 +37|12 +37|72 +37|13 +37|22 +37|96 +37|71 +37|91 +37|46 +37|64 +37|24 +37|54 +37|42 +37|78 +37|87 +37|67 +37|69 +37|26 +37|55 +37|18 +37|66 +37|29 +37|93 +37|45 +91|24 +91|67 +91|72 +91|42 +91|65 +91|29 +91|13 +91|64 +91|54 +91|85 +91|35 +91|93 +91|36 +91|87 +91|97 +91|16 +91|22 +91|96 +91|12 +91|26 +91|38 +91|69 +91|79 +91|71 +54|16 +54|97 +54|58 +54|13 +54|42 +54|67 +54|79 +54|65 +54|28 +54|81 +54|93 +54|73 +54|77 +54|72 +54|64 +54|29 +54|31 +54|85 +54|11 +54|15 +54|38 +54|36 +54|51 +54|35 +22|85 +22|15 +22|28 +22|93 +22|42 +22|81 +22|38 +22|67 +22|64 +22|36 +22|29 +22|72 +22|77 +22|65 +22|79 +22|16 +22|35 +22|11 +22|24 +22|13 +22|58 +22|31 +22|54 +22|97 +38|79 +38|51 +38|16 +38|73 +38|47 +38|18 +38|81 +38|28 +38|85 +38|94 +38|11 +38|61 +38|86 +38|31 +38|37 +38|65 +38|77 +38|97 +38|15 +38|32 +38|48 +38|36 +38|21 +38|58 +97|81 +97|31 +97|85 +97|51 +97|77 +97|79 +97|86 +97|45 +97|28 +97|61 +97|21 +97|18 +97|11 +97|47 +97|73 +97|36 +97|16 +97|39 +97|58 +97|32 +97|48 +97|15 +97|94 +97|37 +93|65 +93|85 +93|77 +93|51 +93|81 +93|97 +93|31 +93|79 +93|11 +93|38 +93|58 +93|16 +93|21 +93|32 +93|35 +93|28 +93|61 +93|15 +93|48 +93|36 +93|47 +93|94 +93|73 +93|86 +64|32 +64|79 +64|11 +64|48 +64|94 +64|15 +64|73 +64|61 +64|16 +64|97 +64|35 +64|28 +64|31 +64|58 +64|77 +64|81 +64|86 +64|47 +64|51 +64|65 +64|85 +64|36 +64|38 +64|93 +48|87 +48|24 +48|55 +48|66 +48|94 +48|96 +48|13 +48|22 +48|46 +48|71 +48|69 +48|47 +48|39 +48|37 +48|61 +48|29 +48|54 +48|26 +48|45 +48|18 +48|78 +48|21 +48|91 +48|12 +24|42 +24|38 +24|15 +24|77 +24|85 +24|58 +24|13 +24|28 +24|67 +24|72 +24|65 +24|11 +24|79 +24|81 +24|64 +24|16 +24|54 +24|35 +24|36 +24|97 +24|29 +24|31 +24|93 +24|51 +94|96 +94|12 +94|13 +94|46 +94|66 +94|71 +94|91 +94|29 +94|55 +94|39 +94|24 +94|69 +94|67 +94|37 +94|22 +94|21 +94|87 +94|42 +94|26 +94|54 +94|72 +94|18 +94|45 +94|78 +71|65 +71|67 +71|15 +71|38 +71|85 +71|54 +71|64 +71|29 +71|36 +71|72 +71|77 +71|35 +71|93 +71|81 +71|16 +71|69 +71|97 +71|28 +71|79 +71|58 +71|22 +71|24 +71|13 +71|42 +45|35 +45|64 +45|26 +45|12 +45|42 +45|24 +45|67 +45|96 +45|71 +45|69 +45|54 +45|46 +45|66 +45|38 +45|78 +45|29 +45|13 +45|72 +45|22 +45|91 +45|55 +45|65 +45|87 +45|93 +15|87 +15|96 +15|37 +15|66 +15|48 +15|11 +15|86 +15|31 +15|21 +15|12 +15|18 +15|45 +15|47 +15|94 +15|32 +15|61 +15|46 +15|39 +15|26 +15|78 +15|91 +15|73 +15|55 +15|51 +32|39 +32|69 +32|45 +32|48 +32|71 +32|12 +32|61 +32|46 +32|91 +32|24 +32|22 +32|66 +32|54 +32|47 +32|37 +32|13 +32|26 +32|55 +32|87 +32|94 +32|21 +32|18 +32|78 +32|96 +18|96 +18|69 +18|29 +18|91 +18|72 +18|26 +18|93 +18|42 +18|12 +18|55 +18|35 +18|71 +18|78 +18|54 +18|22 +18|46 +18|64 +18|24 +18|39 +18|67 +18|66 +18|87 +18|45 +18|13 +35|38 +35|73 +35|85 +35|16 +35|61 +35|81 +35|47 +35|79 +35|58 +35|21 +35|28 +35|94 +35|15 +35|51 +35|31 +35|86 +35|36 +35|65 +35|48 +35|32 +35|37 +35|11 +35|77 +77|61 +77|21 +77|15 +77|37 +77|18 +77|55 +77|11 +77|96 +77|31 +77|12 +77|78 +77|51 +77|26 +77|39 +77|48 +77|91 +77|47 +77|32 +77|45 +77|94 +77|73 +77|46 +72|58 +72|51 +72|35 +72|65 +72|47 +72|77 +72|64 +72|86 +72|36 +72|11 +72|85 +72|15 +72|81 +72|32 +72|28 +72|73 +72|97 +72|48 +72|31 +72|61 +72|93 +13|93 +13|67 +13|77 +13|58 +13|36 +13|73 +13|81 +13|51 +13|11 +13|72 +13|35 +13|97 +13|42 +13|28 +13|85 +13|79 +13|86 +13|16 +13|29 +13|64 +31|87 +31|48 +31|39 +31|86 +31|78 +31|55 +31|11 +31|32 +31|21 +31|45 +31|91 +31|94 +31|26 +31|37 +31|12 +31|73 +31|18 +31|51 +31|66 +28|51 +28|48 +28|86 +28|61 +28|31 +28|46 +28|77 +28|37 +28|91 +28|78 +28|73 +28|58 +28|15 +28|18 +28|94 +28|21 +28|39 +28|32 +66|24 +66|91 +66|12 +66|29 +66|35 +66|38 +66|55 +66|72 +66|87 +66|22 +66|54 +66|42 +66|26 +66|78 +66|67 +66|97 +66|96 +85|51 +85|37 +85|15 +85|61 +85|47 +85|28 +85|94 +85|66 +85|31 +85|45 +85|81 +85|73 +85|48 +85|11 +85|32 +85|77 +29|85 +29|58 +29|51 +29|97 +29|65 +29|72 +29|73 +29|77 +29|16 +29|31 +29|35 +29|15 +29|86 +29|93 +29|32 +12|72 +12|64 +12|97 +12|65 +12|96 +12|24 +12|69 +12|42 +12|35 +12|67 +12|54 +12|38 +12|13 +12|81 +61|12 +61|22 +61|26 +61|94 +61|87 +61|45 +61|24 +61|69 +61|37 +61|39 +61|55 +61|66 +61|54 +58|86 +58|31 +58|12 +58|15 +58|66 +58|37 +58|73 +58|77 +58|11 +58|21 +58|18 +58|61 +55|72 +55|22 +55|85 +55|12 +55|93 +55|91 +55|87 +55|13 +55|97 +55|96 +55|29 +79|66 +79|47 +79|46 +79|94 +79|86 +79|11 +79|77 +79|21 +79|51 +79|55 +46|93 +46|24 +46|35 +46|12 +46|42 +46|26 +46|85 +46|71 +46|54 +47|21 +47|78 +47|18 +47|12 +47|91 +47|22 +47|66 +47|87 +73|91 +73|55 +73|37 +73|32 +73|45 +73|71 +73|96 +42|28 +42|58 +42|51 +42|47 +42|31 +42|73 +51|12 +51|22 +51|48 +51|87 +51|78 +39|29 +39|64 +39|26 +39|87 +36|15 +36|31 +36|55 +78|67 +78|38 +96|93 + +64,93,35,38,97,16,79,36,81,28,58,77,31,11,51,73,86,32,48,47,61 +48,47,21,78,12,26,71,24,13 +46,55,69,32,87,26,61,12,71,45,66,86,37,91,22,78,21,96,73,94,18 +16,79,81,28,77,31,73,61,94,21,37,18,39,45,66 +73,86,51,91,78,94,26,15,12,61,31,21,47,11,18,32,55,46,66 +85,54,15,67,77,35,97,42,31 +91,24,64,93,65,16,79 +36,81,28,58,77,15,11,86,32,47,61,21,37,39,45,55,46 +13,94,12,55,45,18,91,46,96,39,78,61,48,21,69,87,37,22,71,26,47,66,24 +85,77,35,28,42,13,15,58,97 +35,38,97,16,36,81,28,31,11,51,48,47,61,94,21 +77,15,31,11,51,73,86,32,48,47,94,21,39,45,66,55,46,78,91,12,96 +28,51,66,79,58,45,77,15,48,21,36,39,61,32,86,16,73,94,37,31,18,11,81 +35,93,28,15,24,97,11,67,77,16,38,36,65,58,31,64,29,79,72 +36,48,85,51,28,77,31,81,11 +94,81,31,48,18,51,28,36,37,86,58,11,45,61,47,39,77,85,15,21,16 +18,78,87,24,29 +16,81,15,31,73,32,47,21,18,39,66 +97,64,67,15,72,36,77,31,22 +39,54,69,18,47,24,37,32,26,66,71,91,94,45,46 +31,86,37,73,15,21,91,66,39,46,51,77,11,96,55,94,18 +91,96,71,42,64,93,35,85,16 +58,77,93,16,38,54,97,85,67,15,81,11,51 +86,32,47,94,37,18,45,55,46,91,12,96,26,69,24 +93,24,36,67,97,28,77,79,13,81,71,64,69,38,29,22,42,54,58,85,35,16,65 +35,85,36,58,11,32,48,47,94 +11,35,86,28,32,67,36,81,16 +81,58,15,73,94,21,37,66,55,46,78 +37,55,28,48,51,81,45,73,47,58,66,79,15,11,18,31,86,77,94 +32,48,47,61,94,21,37,18,45,66,55,46,78,12,96,26,87,69,22,24,54 +48,47,94,21,37,18,39,45,66,55,46,78,91,12,96,26,87,71,69,22,24,54,13 +31,86,47,21,66,46,78,96,87 +38,97,85,16,79,36,81,28,58,15,31,11,51,73,86,32,48,61,94,21,37 +39,66,55,46,78,91,26,87,71,69,22,24,54,13,29,67,42,72,64,93,35 +65,85,16,36,28,86,48,61,94,21,18 +73,86,48,12,51,96,46,69,32,91,66 +58,77,15,31,11,73,86,32,48,47,61,21,39,45,55,46,12 +48,39,15,28,85 +22,54,67,38,16,28,58 +78,12,87,42,72,38,16 +69,64,71,67,29,87,55,35,24,91,65,42,97,46,93,72,26 +32,48,47,61,21,18,39,45,66,55,46,78,91,12,96,87,71,69,22,24,54 +11,73,32,47,18,39,66,55,46,78,12,96,26,87,71 +12,55,73,32,48,87,39,21,94,18,61,91,45,37,46,69,26,86,96 +71,69,24,54,13,67,42,64,35,65,97,85,16,79,36,81,28,58,77 +67,72,64,35,97,85,16,81,28,15,11,73,32 +86,97,48,51,32,58,65,36,73,93,28,11,38,61,64,31,47,81,77,35,15,79,16 +94,21,37,18,39,45,46,78,96,69,22,24,29,67,42 +71,69,22,54,13,29,67,42,72,64,93,35,85,16,79,36,28,58,77 +45,66,46,78,26,87,71,69,22,13,29,67,42,72,93,35,38 +21,18,39,45,55,91,12,26,87,71,24,13,42 +26,46,94,69,66,47,91,96,24,37,22,13,61,29,87 +47,72,93,81,51,11,38,48,64,32,77,35,65 +37,18,39,55,46,12,96,87,22,24,54,13,72 +12,46,35,64,85,71,26 +28,58,77,31,51,73,86,32,48,47,61,37,18,39,45,66,55,46,91 +86,32,48,47,61,94,21,37,18,45,66,55,46,78,91,12,96,26,87,71,69,22,24 +78,12,96,13,67,72,64,93,85 +78,91,12,96,26,87,71,22,24,54,13,29,42,72,64,93,35,38,65,85,16 +38,71,42,29,97,87,12,78,16 +96,87,22,24,54,67,72,93,85,36,81 +86,61,94,39,45,66,55,46,78,71,69 +94,96,46,86,31,91,26,61,11,48,47,18,32,66,51,37,15 +48,47,61,94,21,18,39,45,55,46,78,91,12,26,87,71,69,22,24,54,13 +67,81,58,77,31 +12,71,54,37,39,29,91,96,64,69,87,78,46,13,26,22,24 +54,72,38,16,81,15,51 +21,47,81,31,39,51,77,11,32,73,36,15,16,28,85,37,97,86,48 +78,96,69,91,55,66,12,13,54,47,46,45,21,26,18 +96,69,54,72,64,79,81 +65,36,15,11,51,21,18 +94,21,37,18,39,45,66,55,78,91,12,96,26,87,71,69,22,24,54,13,29,67,42 +38,65,97,85,16,79,36,81,28,58,77,15,31,11,51,73,32,48,47,61,94,21,37 +22,67,85,24,93,77,72,35,69,16,15,64,97,28,81,42,38 +39,61,66,51,36,46,18 +94,73,39,51,45,55,78,66,46,15,48,47,12,32,37,26,18,31,86 +13,16,22,69,78,65,12,26,87,38,85,96,71 +39,28,15,79,21,47,73,36,37,48,11,58,77,81,45,61,31 +72,37,91,12,26,18,78,66,42,64,87,46,55,45,96,24,29 +65,79,93,69,36,38,72,58,71,29,85,42,67,54,24,35,13,64,87,97,28,16,81 +12,96,29,67,72,38,65,85,36 +29,54,12,69,13,91,78,64,67,35,26,93,24,46,96 +13,35,65,85,16,79,81,58,77,51,73 +66,46,12,55,69,61,39,71,67,37,18,45,94,21,13,26,96 +16,11,29,77,15,72,36,51,67,58,64,93,79,73,97,38,86,65,42,85,31,35,28 +51,73,32,47,61,94,37,18,39,45,66,55,78,91,26 +85,51,73,79,94,86,61,16,47,65,37,97,18,32,28,21,15,48,11,31,77,36,58 +45,66,55,46,26,71,22,54,13,67,42,35,38 +81,28,58,77,15,31,11,51,73,86,32,48,47,61,94,37,18,39,45,66,55,46,78 +36,28,15,31,73,86,32,48,47,61,94,21,37,18,45 +61,94,21,37,18,39,45,66,55,46,78,12,96,26,87,71,69,22,24,54,13,29,67 +87,91,55,66,54,46,71,24,22,42,29,69,12,93,35,39,26,72,13 +29,67,42,72,64,93,35,38,97,85,16,79,36,81,58,77,15,11,51,73,86 +47,61,37,18,39,45,66,91,12,96,26,87,69,24,54,13,29 +15,11,51,86,32,48,47,94,37,39,45,66,55,78,12,96,26 +71,61,78,48,26,18,55,45,96,54,94,39,66,24,32,21,91 +28,66,55,94,77 +97,67,24,16,64,69,26,93,78,13,72 +79,36,81,28,58,77,15,31,11,51,73,86,32,48,47,61,21,37,18,39,45,66,55 +22,54,29,67,42,72,64,93,38,16,79,36,81,28,58,15,31 +11,86,51,48,15,55,47,18,96,32,91 +38,26,54,42,35,69,96,45,78,22,29,46,91,72,64,24,71,12,66 +58,77,15,11,73,86,32,48,47,21,37,66,46,78,12 +54,29,42,72,64,35,38,16,79,36,58,11,51 +11,55,66,87,94,61,47,86,71,91,39,96,21,73,48,51,45 +86,61,96,73,66,77,21,47,48,18,11,78,45,46,94,12,51,31,32,15,37 +29,67,42,64,93,35,38,65,97,85,16,79,36,81,28,77,15,11,51,73,86 +93,38,65,81,28,58,15 +31,81,24,36,38,93,97,64,11,28,77,35,42,54,79,67,72,13,16,29,58 +65,97,79,36,81,77,51,73,21,37,18 +28,86,47,18,39,45,55 +18,48,69,26,91,32,39,94,86,37,21,47,96,78,45,55,87,66,24,61,46 +15,51,73,86,32,47,94,21,37,45,55,91,26 +24,46,67,72,91,69,64,22,26,29,93,71,13,54,96,78,12,38,87,97,65 +67,93,38,85,36,28,58 +85,72,29,35,67,22,31 +81,28,15,31,11,86,48,47,61,94,21,37,18,39,45,66,55,46,78 +35,16,64,77,81,15,36,93,86,85,38,11,51,72,47,79,97 +45,66,46,61,15,86,78,39,94,18,51,48,77,73,31,37,32,21,47,58,81 +71,24,67,42,65,79,36,81,28,58,77 +61,86,11,18,36,39,48,94,15,77,28,47,55,37,58,21,45,51,73 +13,29,72,64,93,38,65,97,85,16,79,36,81,28,58,77,15,31,11,51,73 +15,97,16,54,85,42,31,28,22,93,81 +71,67,26,66,18,45,78,12,61 +38,54,85,67,36,29,24,65,64,96,71,12,26,97,16,93,79,72,35,42,22 +12,86,45,31,47,51,94,37,96,21,18 +96,72,13,21,69,71,78 +86,48,37,55,46,91,71,69,22 +26,55,66,48,94,71,45,12,32,11,96,86,61 +15,97,29,31,28,64,38,35,93,51,85,65,73,36,77,16,67,11,42 +21,37,18,39,45,66,55,46,78,91,12,96,26,87,71,69,22,54,13,29,67,42,72 +45,51,36,73,31,48,94,32,58,21,66,28,81,15,61,79,11,77,55 +36,79,28,47,48,58,38,85,73,93,61,86,97,51,31,65,32,15,11,94,35,16,77 +91,12,22,29,64,65,79 +47,61,94,21,37,45,91,96,87,69,22,24,29 +42,64,93,35,65,16,79,81,58,31,11,51,73,86,32 +37,13,71,21,39,69,66,46,96,12,24 +79,15,47,45,21,77,51,16,85 +77,94,32,73,61,18,55 +66,55,46,78,91,12,96,26,71,69,22,24,54,13,29,67,42,72,64,93,35,38,65 +79,36,28,58,77,15,31,11,73,86,32,48,47,61,94,21,37,18,39,66,55 +65,72,87,69,54,24,35,66,71 +26,24,13,29,42,72,64,93,65,85,16,79,28 +11,73,32,61,37,18,39,66,55,12,71 +73,48,61,94,21,37,18,39,55,46,78,12,96,26,87,69,22 +93,48,35,97,47,85,81,77,61,28,31,94,15,65,51,58,86,73,11 +26,38,72,46,12,97,71,93,64,24,55,67,35 +16,65,97,31,36,15,51,58,11,73,32,42,67,93,77,28,86,72,38 +32,31,87,51,91,47,21,11,37,73,46 +71,24,54,13,29,67,42,72,64,93,35,38,97,85,16,79,36,81,28,58,77 +78,26,29,35,46,69,54,45,87,13,96,42,67,93,71,12,39,64,91 +37,79,94,28,31,36,77,61,97,86,51,11,16,48,18,85,65,47,58,81,32,73,21 +69,24,13,29,93,35,38,65,97 +69,29,42,72,38,85,16,28,15 +42,72,64,38,65,97,16,79,36,81,28,58,15,51,73,86,48 +86,61,94,21,18,39,66,91,12,96,71,69,24 +37,39,45,66,55,78,91,96,26,87,71,69,24,13,29 +85,79,81,28,15,31,11,51,86,32,47,94,21,37,18,39,45 +64,54,65,85,38,69,16,67,26,42,13,97,29,79,36,12,87,35,96 +78,24,71,97,55,96,29 +45,66,55,46,78,91,12,96,26,87,69,24,29,42,64,35,38 +31,51,73,86,32,94,21,18,45,66,87 +54,13,67,64,93,35,38,65,97,79,36,28,58,77,31,11,51 +61,21,37,45,66,78,12,96,69,22,24,54,13,29,67 +12,39,31,55,37,78,58 +26,61,18,22,45,67,46,37,69,94,12 +86,32,48,47,61,94,21,37,18,39,45,66,55,46,78,91,12,26,87,71,69,22,24 +77,31,51,48,94,21,37,18,66,55,78,91,12 +67,94,96,12,29,18,39,13,26,71,78,46,45,21,69,55,66 +48,94,21,37,39,45,66,55,46,78,71,69,22,24,13 +69,46,32,47,55,48,45,94,21,87,78,61,39,12,73,18,86,51,26,37,66 +37,39,45,66,55,78,91,12,87,71,69,22,24,54,72 +78,91,12,96,26,71,69,22,24,54,13,67,42,72,64,35,65,85,16 +21,37,18,39,45,55,46,78,91,12,96,26,87,71,69,22,24,54,13,29,67,42,72 +37,58,21,94,55,39,86,45,18,11,46,31,66,36,15 +37,18,39,48,46,47,81,15,61,11,58,77,66,51,21,94,55,36,31 +61,94,45,47,78,46,13,26,39,54,22,69,48,18,37 +73,77,47,58,61,12,91,11,18,31,45,86,32,21,55 +15,45,31,32,86,16,61,48,85,28,11,37,21,73,58,18,47 +65,97,85,16,79,36,81,58,77,15,31,11,51,73,86,32,48,47,61,94,21,37,18 +46,91,12,96,71,22,13,29,65,97,85 +54,29,64,93,65,85,16,31,51 +87,22,24,54,13,29,67,42,72,64,93,35,38,65,97,16,79,36,81,28,58 +64,22,91,87,38,26,42,72,13,67,65,55,69,29,93,71,78,35,24,96,46 +64,24,13,26,72,39,55 +85,11,36,86,35,42,16,64,51,72,38,93,79,81,48,31,58 +38,32,58,64,97,81,16,73,31,85,51,42,93,35,11,86,65,72,36,79,28,67,77 +66,55,46,78,12,96,26,87,71,69,22,24,54,13,29,67,42,64,93,35,38 +18,66,78,22,67 +37,66,46,91,96,87,71,69,24,13,29,72,64 +37,39,45,66,55,46,78,12,96,71,69,22,54,29,42,72,64 +96,91,66,77,48,73,55,51,32,86,61,47,18,94,15 +32,48,47,61,37,18,39,45,66,55,46,78,91,12,96,87,71,69,22,24,54 +72,93,38,16,79,28,15,11,51,86,32,48,47 +15,31,51,73,86,32,47,61,94,37,18,45,91,96,26 +69,24,29,67,93,38,65,28,15 \ No newline at end of file diff --git a/AdventOfCode.Solutions/AdventOfCode.Solutions.csproj b/AdventOfCode.Solutions/AdventOfCode.Solutions.csproj index 74cef46..c4322b4 100644 --- a/AdventOfCode.Solutions/AdventOfCode.Solutions.csproj +++ b/AdventOfCode.Solutions/AdventOfCode.Solutions.csproj @@ -34,6 +34,9 @@ Always + + Always + Always diff --git a/AdventOfCode.Solutions/day-00-input.txt b/AdventOfCode.Solutions/day-00-input.txt index c41c5ea..d4d4441 100644 --- a/AdventOfCode.Solutions/day-00-input.txt +++ b/AdventOfCode.Solutions/day-00-input.txt @@ -1,10 +1,28 @@ -MMMSXXMASM -MSAMXMSMSA -AMXSXMAAMM -MSAMASMSMX -XMASAMXAMM -XXAMMXXAMA -SMSMSASXSS -SAXAMASAAA -MAMMMXMMMM -MXMXAXMASX \ No newline at end of file +47|53 +97|13 +97|61 +97|47 +75|29 +61|13 +75|53 +29|13 +97|29 +53|29 +61|53 +97|53 +61|29 +47|13 +75|47 +97|75 +47|61 +75|61 +47|29 +75|13 +53|13 + +75,47,61,53,29 +97,61,53,29,13 +75,29,13 +75,97,47,61,53 +61,13,29 +97,13,75,29,47 \ No newline at end of file