From e93bf9ecd76ff29ec691000ed4c7e204ccf13c7b Mon Sep 17 00:00:00 2001 From: Boxfriend Date: Wed, 3 Dec 2025 13:06:55 -0500 Subject: [PATCH] part 1 brute forced --- AdventOfCode2025/Lobby.cs | 29 +++++++++++++++++++++++++++++ AdventOfCode2025/Program.cs | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 AdventOfCode2025/Lobby.cs diff --git a/AdventOfCode2025/Lobby.cs b/AdventOfCode2025/Lobby.cs new file mode 100644 index 0000000..de0287d --- /dev/null +++ b/AdventOfCode2025/Lobby.cs @@ -0,0 +1,29 @@ +using System.Runtime.InteropServices.JavaScript; +using AdventOfCode2025.Utils; + +namespace AdventOfCode2025; + +public class Lobby : IAdventSolution +{ + public AdventSolution Solve(string input) + { + var lines = input.SplitLines(); + var total = 0; + foreach (var line in lines) + { + var max = 0; + for (var i = 0; i < line.Length; i++) + { + for (var j = i + 1; j < line.Length; j++) + { + var num = int.Parse(line[i].ToString() + line[j].ToString()); + if (num > max) max = num; + + } + } + total += max; + } + + return new AdventSolution(total.ToString(), null); + } +} \ No newline at end of file diff --git a/AdventOfCode2025/Program.cs b/AdventOfCode2025/Program.cs index 6f8159e..a53ca84 100644 --- a/AdventOfCode2025/Program.cs +++ b/AdventOfCode2025/Program.cs @@ -8,5 +8,5 @@ AdventSolver.Solve(dayOneInput, 1, "Secret Entrance"); var dayTwoInput = await File.ReadAllTextAsync("./Input/DayTwo.txt"); AdventSolver.Solve(dayTwoInput, 2, "Gift Shop"); -var dayThreeInput = await File.ReadAllTextAsync("./Input/Test.txt"); +var dayThreeInput = await File.ReadAllTextAsync("./Input/DayThree.txt"); AdventSolver.Solve(dayThreeInput, 3, "Lobby"); \ No newline at end of file