Merge pull request #3 from StevanFreeborn/stevanfreeborn/feat/solve-puzzle-3

feat: solve puzzle 3
This commit is contained in:
Stevan Freeborn
2023-12-03 23:04:17 -06:00
committed by GitHub
13 changed files with 903 additions and 8 deletions
+4 -4
View File
@@ -9,16 +9,16 @@ public class Program
if (args.Length is 0) if (args.Length is 0)
{ {
Console.WriteLine("Please provide a path to the input file."); Console.WriteLine("Please provide a path to the input file.");
return 1; return -1;
} }
if (File.Exists(args[0]) is false) if (File.Exists(args[0]) is false)
{ {
Console.WriteLine("The provided file does not exist."); Console.WriteLine("The provided file does not exist.");
return 2; return -2;
} }
IPuzzleSolver puzzleSolver = args.Length > 1 && args[1] == "2" IPuzzleSolver puzzleSolver = args.Length > 1 && args[1] == "part2"
? new PartTwoPuzzleSolver() ? new PartTwoPuzzleSolver()
: new PartOnePuzzleSolver(); : new PartOnePuzzleSolver();
@@ -27,7 +27,7 @@ public class Program
Console.WriteLine($"The sum of all calibration values is {result}."); Console.WriteLine($"The sum of all calibration values is {result}.");
return 0; return result;
} }
} }
+7
View File
@@ -26,7 +26,14 @@ public class Program
? puzzleSolver.SumGameMinimumPowers(games) ? puzzleSolver.SumGameMinimumPowers(games)
: puzzleSolver.SumPossibleGameIds(games); : puzzleSolver.SumPossibleGameIds(games);
if (args.Length > 1 && args[1] == "part2")
{
Console.WriteLine($"The sum of the minimum powers of all games is {result}.");
}
else
{
Console.WriteLine($"The sum of all possible game ids is {result}."); Console.WriteLine($"The sum of all possible game ids is {result}.");
}
return result; return result;
} }
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GearRatios\GearRatios.csproj" />
</ItemGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
global using FluentAssertions;
global using Xunit;
+353
View File
@@ -0,0 +1,353 @@
namespace GearRatios.Test;
public class LineTests
{
[Theory, MemberData(nameof(TestData.LineData), MemberType = typeof(TestData))]
public void Parse_GivenLine_ItShouldParseExpectedValues(string line, Line expected)
{
var actual = Line.Parse(line);
actual.Should().BeEquivalentTo(expected);
}
[Theory, MemberData(nameof(TestData.PartNumberData), MemberType = typeof(TestData))]
public void GetPartNumbers_GivenLine_ItShouldReturnExpectedValues(Line currentLine, Line? prevLine, Line? nextLine, List<int> expected)
{
var actual = currentLine.GetPartNumbers(prevLine, nextLine);
actual.Should().BeEquivalentTo(expected);
}
[Theory, MemberData(nameof(TestData.GearData), MemberType = typeof(TestData))]
public void GetGearRatios_GivenLine_ItShouldReturnExpectedValues(Line currentLine, Line? prevLine, Line? nextLine, List<int> expected)
{
var actual = currentLine.GetGearRatios(prevLine, nextLine);
actual.Should().BeEquivalentTo(expected);
}
public static class TestData
{
public static IEnumerable<object?[]> GearData =>
new List<object?[]>
{
new object?[]
{
new Line(
[],
[]
),
null,
null,
new List<int>(),
},
new object?[]
{
new Line(
[
new()
{
{ 467, new Indexes(0, 2) },
},
new()
{
{ 114, new Indexes(5, 7) },
},
],
[
]
),
null,
null,
new List<int>(),
},
new object?[]
{
new Line(
[],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
null,
null,
new List<int>(),
},
new object?[]
{
new Line(
[
new()
{
{ 617, new Indexes(0, 2) },
{ 114, new Indexes(4, 6) },
},
],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
null,
null,
new List<int> { 617 * 114 },
},
new object?[]
{
new Line(
[],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
new Line(
[
new()
{
{ 467, new Indexes(0, 2) },
},
new()
{
{ 114, new Indexes(5, 7) },
},
],
[]
),
new Line(
[
new()
{
{ 35, new Indexes(2, 3) },
},
new()
{
{ 633, new Indexes(6, 8) },
},
],
[]
),
new List<int> { 467 * 35 },
}
};
public static IEnumerable<object?[]> PartNumberData =>
new List<object?[]>
{
new object?[]
{
new Line(
[
new()
{
{ 467, new Indexes(0, 2) },
},
new()
{
{ 114, new Indexes(5, 7) },
},
],
[
]
),
null,
null,
new List<int>(),
},
new object?[]
{
new Line(
[],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
null,
null,
new List<int>(),
},
new object?[]
{
new Line(
[
new()
{
{ 617, new Indexes(0, 2) },
},
],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
null,
null,
new List<int> { 617 },
},
new object?[]
{
new Line(
[
new()
{
{ 617, new Indexes(0, 2) },
},
new()
{
{ 114, new Indexes(6, 8) },
},
],
[
new()
{
{ "*", new Indexes(3, 3) },
},
new()
{
{ "*", new Indexes(9, 9) },
},
]
),
null,
null,
new List<int> { 617, 114 },
},
new object?[]
{
new Line(
[
new()
{
{ 467, new Indexes(0, 2) },
},
new()
{
{ 114, new Indexes(5, 7) },
},
],
[
]
),
null,
new Line(
[],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
new List<int>() { 467 },
},
new object?[]
{
new Line(
[
new()
{
{ 58, new Indexes(7, 8) },
},
],
[
new()
{
{ "+", new Indexes(5, 5) },
},
]
),
new Line(
[
new()
{
{ 617, new Indexes(0, 2) },
},
],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
new Line(
[
new()
{
{ 592, new Indexes(2, 4) },
},
],
[]
),
new List<int>(),
},
};
public static IEnumerable<object[]> LineData =>
new List<object[]>
{
new object[]
{
"467..114..",
new Line(
[
new()
{
{ 467, new Indexes(0, 2) },
},
new()
{
{ 114, new Indexes(5, 7) },
},
],
[]
),
},
new object[]
{
"...*......",
new Line(
[],
[
new()
{
{ "*", new Indexes(3, 3) },
},
]
),
},
new object[]
{
"...41+...564",
new Line(
[
new()
{
{ 41, new Indexes(3, 4) },
},
new()
{
{ 564, new Indexes(9, 11) },
},
],
[
new()
{
{ "+", new Indexes(5, 5) },
},
]
),
}
};
};
}
+90
View File
@@ -0,0 +1,90 @@
namespace GearRatios.Test;
public class PuzzleSolverTests
{
private readonly PuzzleSolver _sut = new();
[Theory]
[MemberData(nameof(TestData.SumPartNumbersData), MemberType = typeof(TestData))]
public void SumPartNumbers_GivenSchematic_ItShouldReturnExpectedValue(string[] schematic, int expected)
{
var actual = _sut.SumPartNumbers(schematic);
actual.Should().Be(expected);
}
[Theory]
[MemberData(nameof(TestData.SumGearRatios), MemberType = typeof(TestData))]
public void SumGearRatios_GivenSchematic_ItShouldReturnExpectedValue(string[] schematic, int expected)
{
var actual = _sut.SumGearRatios(schematic);
actual.Should().Be(expected);
}
public static class TestData
{
private static readonly string[] TestSchematic =
[
"467..114..",
"...*......",
"..35..633.",
"......#...",
"617*......",
".....+.58.",
"..592.....",
"......755.",
"...$.*....",
".664.598..",
];
public static IEnumerable<object[]> SumGearRatios =>
new List<object[]>
{
new object[]
{
TestSchematic,
467835,
},
};
public static IEnumerable<object?[]> SumPartNumbersData =>
new List<object?[]>
{
new object?[]
{
TestSchematic,
4361,
},
new object[]
{
new[]
{
"...................305.124................................432..............................................576..313.....514.................",
".............113...-......&....................&...819...........654..../..........................&901................*....869.257.........",
"...377..&783../.................................9...........855*......940..463................-.........................844.*....@......679.",
"......*...........197.261.....817..336.759............&742......548.......&........748......844.............#.......&........254...169..*...",
},
10421,
},
new object[]
{
new[]
{
".............................457....834.....................94..564..........&.........498....*...304....../...*.....*..........845.....&...",
".......12*48.753...244..196....=......$..721....90*29.........*.................+.522.......487...............317.....531..311........20....",
".177...............*.....*.................*.............*969.611.......*565..338...*.............712..922$.......770......*....522.........",
},
8318
},
new object[]
{
new[]
{
"663..462...........*..........109..706*.................=.............553........712......*971......674.396...635*..........................",
"........../...728.952...413......*......744.......%..........................300..*....782................*.......742..&424........41+...564",
"........375...%.........*......450.456.$.........714........851.327..#...+......*...+.......179.630....854.................................*",
},
11612
}
};
}
}
+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+285
View File
@@ -0,0 +1,285 @@
namespace GearRatios;
public class Program
{
public async static Task<int> Main(string[] args)
{
if (args.Length is 0)
{
Console.WriteLine("Please provide a path to the input file.");
return -1;
}
if (File.Exists(args[0]) is false)
{
Console.WriteLine("The provided file does not exist.");
return -2;
}
var puzzleSolver = new PuzzleSolver();
var input = await File.ReadAllLinesAsync(args[0]);
var result = args.Length > 1 && args[1] == "part2"
? puzzleSolver.SumGearRatios(input)
: puzzleSolver.SumPartNumbers(input);
if (args.Length > 1 && args[1] == "part2")
{
Console.WriteLine($"The sum of all gear ratios is {result}.");
}
else
{
Console.WriteLine($"The sum of all part numbers is {result}.");
}
return result;
}
}
/// <summary>
/// Solves the puzzle.
/// </summary>
public class PuzzleSolver
{
/// <summary>
/// Sums all part numbers in the schematic.
/// </summary>
/// <param name="schematic">The schematic to parse.</param>
/// <returns>The sum of all part numbers.</returns>
public int SumPartNumbers(string[] schematic)
{
var allPartNumbers = new List<int>();
for (var i = 0; i < schematic.Length; i++)
{
var currentLine = Line.Parse(schematic[i]);
var prevLine = i > 0 ? Line.Parse(schematic[i - 1]) : null;
var nextLine = i < schematic.Length - 1 ? Line.Parse(schematic[i + 1]) : null;
var linePartNumbers = currentLine.GetPartNumbers(prevLine, nextLine);
allPartNumbers.AddRange(linePartNumbers);
}
return allPartNumbers.Sum();
}
/// <summary>
/// Sums all gear ratios in the schematic.
/// </summary>
/// <param name="schematic">The schematic to parse.</param>
/// <returns>The sum of all gear ratios.</returns>
public int SumGearRatios(string[] schematic)
{
var allGearRatios = new List<int>();
for (var i = 0; i < schematic.Length; i++)
{
var currentLine = Line.Parse(schematic[i]);
var prevLine = i > 0 ? Line.Parse(schematic[i - 1]) : null;
var nextLine = i < schematic.Length - 1 ? Line.Parse(schematic[i + 1]) : null;
var lineGearRatios = currentLine.GetGearRatios(prevLine, nextLine);
allGearRatios.AddRange(lineGearRatios);
}
return allGearRatios.Sum();
}
}
/// <summary>
/// Represents a line in the schematic.
/// </summary>
/// <param name="numbers">The numbers in the line.</param>
/// <param name="specialCharacters">The special characters in the line.</param>
/// <returns>A line in the schematic.</returns>
public class Line(
List<Dictionary<int, Indexes>> numbers,
List<Dictionary<string, Indexes>> specialCharacters
)
{
/// <summary>
/// Gets the numbers in the line.
/// </summary>
public List<Dictionary<int, Indexes>> Numbers { get; init; } = numbers;
/// <summary>
/// Gets the special characters in the line.
/// </summary>
public List<Dictionary<string, Indexes>> SpecialCharacters { get; init; } = specialCharacters;
/// <summary>
/// Gets the indexes of all special characters in the line.
/// </summary>
public List<int> SpecialCharacterIndexes => SpecialCharacters.SelectMany(dict => dict.Values).Select(v => v.Start).ToList();
private bool IsGearCharacter(string character) => character == "*";
/// <summary>
/// Gets the gear ratios in the line.
/// </summary>
/// <param name="previousLine">The previous line in the schematic.</param>
/// <param name="nextLine">The next line in the schematic.</param>
/// <returns>A list of gear ratios.</returns>
public List<int> GetGearRatios(Line? previousLine = null, Line? nextLine = null)
{
var gearRatios = new List<int>();
var gearCharacters = SpecialCharacters.Where(dict => dict.Keys.Any(IsGearCharacter)).ToList();
if (previousLine is not null)
{
Numbers.AddRange(previousLine.Numbers);
}
if (nextLine is not null)
{
Numbers.AddRange(nextLine.Numbers);
}
foreach (var gear in gearCharacters)
{
foreach (var (key, value) in gear)
{
var beforeGear = value.Start - 1;
var afterGear = value.End + 1;
var gearNumbers = Numbers
.Where(
n => n.Values.Any(
v =>
v.Start >= beforeGear && v.Start <= afterGear ||
v.End >= beforeGear && v.End <= afterGear
)
)
.SelectMany(n => n.Keys)
.ToList();
if (gearNumbers.Count == 2)
{
gearRatios.Add(gearNumbers.First() * gearNumbers.Last());
}
}
}
return gearRatios;
}
/// <summary>
/// Gets the part numbers in the line.
/// </summary>
/// <param name="previousLine">The previous line in the schematic.</param>
/// <param name="nextLine">The next line in the schematic.</param>
/// <returns>A list of part numbers.</returns>
public List<int> GetPartNumbers(Line? previousLine = null, Line? nextLine = null)
{
var partNumbers = new List<int>();
if (previousLine is not null)
{
SpecialCharacters.AddRange(previousLine.SpecialCharacters);
}
if (nextLine is not null)
{
SpecialCharacters.AddRange(nextLine.SpecialCharacters);
}
foreach (var number in Numbers)
{
foreach (var (key, value) in number)
{
var beforeNumber = value.Start - 1;
var afterNumber = value.End + 1;
if (SpecialCharacterIndexes.Any(idx => idx >= beforeNumber && idx <= afterNumber))
{
partNumbers.Add(key);
}
}
}
return partNumbers;
}
/// <summary>
/// Parses a line in the schematic.
/// </summary>
/// <param name="line">The line to parse.</param>
/// <returns>An instance of <see cref="Line"/>.</returns>
public static Line Parse(string line)
{
var numbers = new List<Dictionary<int, Indexes>>();
var specialCharacters = new List<Dictionary<string, Indexes>>();
var number = string.Empty;
int? numberStart = null;
int? numberEnd;
for (var i = 0; i < line.Length; i++)
{
var currentCharacter = line[i];
if (char.IsDigit(currentCharacter))
{
number += line[i];
numberStart ??= i;
if (i == line.Length - 1)
{
numberEnd = i;
numbers.Add(new()
{
{
int.Parse(number),
new Indexes(numberStart.Value, numberEnd.Value)
}
});
}
}
else
{
if (numberStart.HasValue)
{
numberEnd = i - 1;
numbers.Add(new()
{
{
int.Parse(number),
new Indexes(numberStart.Value, numberEnd.Value)
}
});
number = string.Empty;
numberStart = null;
}
if (currentCharacter == '.')
{
continue;
}
specialCharacters.Add(new()
{
{
currentCharacter.ToString(),
new Indexes(i, i)
}
});
}
}
return new Line(numbers, specialCharacters);
}
}
/// <summary>
/// Represents the start and end indexes of a number or special character.
/// </summary>
public class Indexes(int start, int end)
{
/// <summary>
/// Gets the start index. The start index is the position of the first character in the number or special character.
/// </summary>
public int Start { get; init; } = start;
/// <summary>
/// Gets the end index. The end index is the position of the last character in the number or special character.
/// </summary>
public int End { get; init; } = end;
}
+95
View File
@@ -0,0 +1,95 @@
# Notes
## Contraints
- Periods don't count as special characters
- All lines have same length
- If not a number or period then it is a special character
Each line parsed need to collect all numbers.
Can't know whether a collected number is a part number until we
have also parsed the proceeding or following line.
```text
467..114..
...*......
..35..633.
......#...
617*......
```
After parsing first line we would have `467` with start index 0 and end index 2 and `114` with start index 5 and end index 7.
For 467 to be a part number it needs to have a special character at index 3 or it needs to have a special character at index 1, 2, 3, 4 on the next line.
For 114 to be a part number it needs to have a special character at index 4 or index 8 or it needs to have a special character at index 4, 5, 6, 7 on the next line.
Need to keep track of:
- Previous line - will start as empty
- Current line
- Next line
So you look at the current line and you parse all the numbers with their start and end index. You also parse all special characters with their index.
Then you end up with something like this: currentLine
```json
{
"numbers": [
"467": {
"start": 0,
"end": 2
},
"114": {
"start": 5,
"end": 7
}
],
"specialCharacters": []
}
```
```csharp
var currentLineString = "467..114..";
var currentLine = new Line(currentLineString);
class Line
{
public List<Dictionary<int, Indexes>> Numbers { get; set; }
public List<Dictionary<int, Indexes>> SpecialCharacters { get; set; }
public Line(string line)
{
// parse line
}
}
public class Indexes
{
public int Start { get; set; }
public int End { get; set; }
public Indexes(int start, int length)
{
Start = start;
End = start + length;
}
}
```
Then you see if those numbers are part numbers just by checking if a special character proceeds or follows their start and end indexes.
```csharp
```
If not then you need to see if there is a previous line and whether there is a special character at on the previous line that has an index that is between 1 less than the start index and 1 more than the end index.
If not then you need to see if there is a next line and whether there is a special character at on the next line that has an index that is between 1 less than the start index and 1 more than the end index.
Basic approach:
- Parse the current, previous, and next lines into a model that keeps track of the numbers and special characters and their indexes for that line.
- Then each line should be able to evaluate what is a part number or not. Or what is a gear or not given its previous and next lines.
+16
View File
@@ -15,6 +15,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CubeConundrum", "02\CubeCon
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CubeConundrum.Tests", "02\CubeConundrum.Tests\CubeConundrum.Tests.csproj", "{4825CE42-4717-4DA6-944F-9BD9A825932B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CubeConundrum.Tests", "02\CubeConundrum.Tests\CubeConundrum.Tests.csproj", "{4825CE42-4717-4DA6-944F-9BD9A825932B}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03", "03", "{EA04152D-316A-4AA4-9BC1-57F6A9F3CD4E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GearRatios", "03\GearRatios\GearRatios.csproj", "{F697AC19-C92D-4E2A-975A-1A16A1961133}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GearRatios.Tests", "03\GearRatios.Tests\GearRatios.Tests.csproj", "{FEE9253C-A56B-4735-BDB3-C62220C5B1B1}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -40,11 +46,21 @@ Global
{4825CE42-4717-4DA6-944F-9BD9A825932B}.Debug|Any CPU.Build.0 = Debug|Any CPU {4825CE42-4717-4DA6-944F-9BD9A825932B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4825CE42-4717-4DA6-944F-9BD9A825932B}.Release|Any CPU.ActiveCfg = Release|Any CPU {4825CE42-4717-4DA6-944F-9BD9A825932B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4825CE42-4717-4DA6-944F-9BD9A825932B}.Release|Any CPU.Build.0 = Release|Any CPU {4825CE42-4717-4DA6-944F-9BD9A825932B}.Release|Any CPU.Build.0 = Release|Any CPU
{F697AC19-C92D-4E2A-975A-1A16A1961133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F697AC19-C92D-4E2A-975A-1A16A1961133}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F697AC19-C92D-4E2A-975A-1A16A1961133}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F697AC19-C92D-4E2A-975A-1A16A1961133}.Release|Any CPU.Build.0 = Release|Any CPU
{FEE9253C-A56B-4735-BDB3-C62220C5B1B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FEE9253C-A56B-4735-BDB3-C62220C5B1B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FEE9253C-A56B-4735-BDB3-C62220C5B1B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FEE9253C-A56B-4735-BDB3-C62220C5B1B1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{3F8EAC09-4BC7-43AA-B72B-48DDD2710F6D} = {8C29858C-623A-461A-BF0B-254E151CD9C2} {3F8EAC09-4BC7-43AA-B72B-48DDD2710F6D} = {8C29858C-623A-461A-BF0B-254E151CD9C2}
{4A5226E4-5B90-4D6C-9224-EBE3F04470ED} = {8C29858C-623A-461A-BF0B-254E151CD9C2} {4A5226E4-5B90-4D6C-9224-EBE3F04470ED} = {8C29858C-623A-461A-BF0B-254E151CD9C2}
{95D6522F-4893-4A66-9B39-7F0268E290B8} = {4FD81B09-302F-4C76-BECB-B4559DF3984F} {95D6522F-4893-4A66-9B39-7F0268E290B8} = {4FD81B09-302F-4C76-BECB-B4559DF3984F}
{4825CE42-4717-4DA6-944F-9BD9A825932B} = {4FD81B09-302F-4C76-BECB-B4559DF3984F} {4825CE42-4717-4DA6-944F-9BD9A825932B} = {4FD81B09-302F-4C76-BECB-B4559DF3984F}
{F697AC19-C92D-4E2A-975A-1A16A1961133} = {EA04152D-316A-4AA4-9BC1-57F6A9F3CD4E}
{FEE9253C-A56B-4735-BDB3-C62220C5B1B1} = {EA04152D-316A-4AA4-9BC1-57F6A9F3CD4E}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
+7 -1
View File
@@ -27,13 +27,19 @@ To run the solutions, navigate to the solution folder and run the following comm
dotnet run -- <path-to-input-file> dotnet run -- <path-to-input-file>
``` ```
Or for part 2 solutions
```bash
dotnet run -- <path-to-input-file> part2
```
## Challenges ## Challenges
| Day | Problem | Solution | Status | Notes | | Day | Problem | Solution | Status | Notes |
| --- | -------------------------- | :-----------------------------: | :----: | ------------------------------------------------------------------- | | --- | -------------------------- | :-----------------------------: | :----: | ------------------------------------------------------------------- |
| 01 | [Problem](./01/PROBLEM.md) | [Solution](./01/Trebuchet/) | ✅ | The trickiest part here was accounting for overlapping digit words. | | 01 | [Problem](./01/PROBLEM.md) | [Solution](./01/Trebuchet/) | ✅ | The trickiest part here was accounting for overlapping digit words. |
| 02 | [Problem](./02/PROBLEM.md) | [Solution](./02/CubeConundrum/) | ✅ | The key to me here was to parse the input into a useful model. | | 02 | [Problem](./02/PROBLEM.md) | [Solution](./02/CubeConundrum/) | ✅ | The key to me here was to parse the input into a useful model. |
| 03 | [Problem](./03/PROBLEM.md) | [Solution](./03/) | | | 03 | [Problem](./03/PROBLEM.md) | [Solution](./03/GearRatios/) | | The edge case that got me here was lines ending with a part number. |
| 04 | [Problem](./04/PROBLEM.md) | [Solution](./04/) | ⌛ | | 04 | [Problem](./04/PROBLEM.md) | [Solution](./04/) | ⌛ |
| 05 | [Problem](./05/PROBLEM.md) | [Solution](./05/) | ⌛ | | 05 | [Problem](./05/PROBLEM.md) | [Solution](./05/) | ⌛ |
| 06 | [Problem](./06/PROBLEM.md) | [Solution](./06/) | ⌛ | | 06 | [Problem](./06/PROBLEM.md) | [Solution](./06/) | ⌛ |