34 Commits
2k23 ... master

Author SHA1 Message Date
ded4631c3b [2k25] Add day 8 2025-12-13 17:55:37 +01:00
6cf07be0c6 [2k25] Add day 7 2025-12-07 20:04:48 +01:00
e7afab8c99 [2k25] Add day 6 2025-12-07 15:32:02 +01:00
f100c7596b [2k25] Add day 5 2025-12-06 23:15:01 +01:00
04102d1fec [2k25] Add day 4 2025-12-04 21:35:12 +01:00
a805b5b96a [2k25] Add day 3 2025-12-03 20:56:17 +01:00
533c7437dc [2k25] Add day 2 2025-12-03 20:20:28 +01:00
0c3a8478d4 [2k25] Add day 1 2025-12-01 22:14:56 +01:00
f8843866ca Migrato to .Net 10 2025-12-01 22:13:17 +01:00
69a941d34d Add day 25 2025-01-24 10:19:13 +01:00
d647742ca0 Add day 24 2025-01-24 10:19:13 +01:00
bc79ea9fa6 Add day 23 2025-01-24 10:19:13 +01:00
c0b05d45bc Add day 22 2025-01-24 10:19:13 +01:00
ebd5d67fff Add day 21 2025-01-24 10:19:13 +01:00
217cabac34 Add day 20 2025-01-24 10:19:13 +01:00
0ff21ba937 Add day 19 2025-01-24 10:19:13 +01:00
ed8f30c972 Add day 18 2025-01-24 10:19:12 +01:00
380eeda47b Add day 17 2025-01-24 10:19:12 +01:00
8f8448a0e7 Add day 16 2025-01-24 10:19:12 +01:00
be3fbcd34c Add day 15 2025-01-24 10:19:12 +01:00
ab3ff19db3 Add day 14 2025-01-24 10:19:12 +01:00
10429f3302 Add day 13 2025-01-24 10:19:12 +01:00
5f08adc3cb Add day 12 2025-01-24 10:19:12 +01:00
6e433fcf3d Add day 11 2025-01-24 10:19:12 +01:00
d839ab7ec9 Add day 10 2025-01-24 10:19:12 +01:00
8b46a65d56 Add day 9 2025-01-24 10:19:11 +01:00
ef9892502e Add day 8 2025-01-24 10:19:11 +01:00
9b865a12b1 Add day 7 2025-01-24 10:19:11 +01:00
9920041301 Add day 6 2025-01-24 10:19:11 +01:00
323bb83e56 Add day 5 2025-01-24 10:19:11 +01:00
ca58bd804b Add day 4 2025-01-24 10:19:11 +01:00
bbaa3289f6 Add day 3 2025-01-24 10:19:11 +01:00
83ae67a03a Add day 2 2025-01-24 10:19:11 +01:00
2590458b13 Add day 1 2025-01-24 10:19:10 +01:00
19 changed files with 8753 additions and 1065 deletions

View File

@@ -2,19 +2,24 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="Spectre.Console" Version="0.54.0" />
</ItemGroup>
<ItemGroup>
<None Remove="Inputs\Day1.txt" />
<EmbeddedResource Include="Inputs\Day1.txt" />
<None Remove="Inputs\*" />
<EmbeddedResource Include="Inputs\*" />
</ItemGroup>
<ItemGroup>
<Content Include="Inputs\Day8.txt" />
</ItemGroup>
</Project>

View File

@@ -7,7 +7,7 @@ namespace AdventOfCode;
[MemoryDiagnoser(false)]
public class DayBenchmark
{
private Day Day { get; } = new Day1();
private Day Day { get; } = new Day6();
[GlobalSetup]
public void Setup()

View File

@@ -5,96 +5,83 @@ namespace AdventOfCode.Days;
public class Day1 : Day
{
public override int Number => 1;
public override string Name => "Trebuchet?!";
private static readonly (string, int)[] WrittenDigits =
[
("one" , 1),
("two" , 2),
("three", 3),
("four" , 4),
("five" , 5),
("six" , 6),
("seven", 7),
("eight", 8),
("nine" , 9)
];
public override string Name => "Secret Entrance";
public override void RunPart1(bool display = true)
{
var calibrationSum = 0;
var password = 0;
var dialPosition = 50;
foreach (var line in Input.AsSpan().EnumerateLines())
foreach (var line in Input.EnumerateLines())
{
var firstDigitIndex = line.IndexOfAnyInRange('0', '9');
var lastDigitIndex = line.LastIndexOfAnyInRange('0', '9');
var direction = line[0];
var offset = int.Parse(line[1..]);
var firstDigit = line[firstDigitIndex] - '0';
var lastDigit = line[lastDigitIndex] - '0';
var sign = direction is 'L'
? -1
: +1;
calibrationSum += firstDigit * 10 + lastDigit;
dialPosition = MathMod(dialPosition + (offset * sign), 100);
if (dialPosition is 0)
{
password++;
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Sum of calibration values is: [yellow]{calibrationSum}[/][/]");
AnsiConsole.MarkupLine($"[green]Safe password is: [yellow]{password}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var calibrationSum = 0;
var password = 0;
var dialPosition = 50;
foreach (var line in Input.AsSpan().EnumerateLines())
foreach (var line in Input.EnumerateLines())
{
var minFirstDigitIndex = line.IndexOfAnyInRange('0', '9');
var maxLastDigitIndex = line.LastIndexOfAnyInRange('0', '9');
var direction = line[0];
var offset = int.Parse(line[1..]);
var firstDigitValue = 0;
if (minFirstDigitIndex == -1)
var originalSign = Math.Sign(dialPosition);
var sign = direction is 'L'
? -1
: +1;
dialPosition = dialPosition + (offset * sign);
int clickCount;
if (dialPosition is 0)
{
minFirstDigitIndex = int.MaxValue;
clickCount = 1;
}
else
{
firstDigitValue = line[minFirstDigitIndex] - '0';
}
clickCount = Math.Abs(dialPosition) / 100; // Number of times the dial passed by 0
var lastDigitValue = 0;
if (maxLastDigitIndex == -1)
{
maxLastDigitIndex = int.MinValue;
}
else
{
lastDigitValue = line[maxLastDigitIndex] - '0';
}
foreach (var (writtenDigit, value) in WrittenDigits)
{
var firstWrittenDigitIndex = line.IndexOf(writtenDigit);
if (firstWrittenDigitIndex != -1 && firstWrittenDigitIndex < minFirstDigitIndex)
// If we did a loop around it counts as a "click" too
if (originalSign != 0 && originalSign != Math.Sign(dialPosition))
{
minFirstDigitIndex = firstWrittenDigitIndex;
firstDigitValue = value;
}
var lastWrittenDigitIndex = line.LastIndexOf(writtenDigit);
if (lastWrittenDigitIndex != -1 && lastWrittenDigitIndex > maxLastDigitIndex)
{
maxLastDigitIndex = lastWrittenDigitIndex;
lastDigitValue = value;
clickCount++;
}
}
calibrationSum += 10 * firstDigitValue + lastDigitValue;
dialPosition = MathMod(dialPosition, 100);
password += clickCount;
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Sum of calibration values is: [yellow]{calibrationSum}[/][/]");
AnsiConsole.MarkupLine($"[green]Safe password is: [yellow]{password}[/][/]");
}
}
private static int MathMod(int left, int right)
{
return (Math.Abs(left * right) + left) % right;
}
}

229
Days/Day2.cs Normal file
View File

@@ -0,0 +1,229 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day2 : Day
{
public override int Number => 2;
public override string Name => "Gift Shop";
public override void RunPart1(bool display = true)
{
var inputSpan = Input.AsSpan();
var sum = 0L;
// Parse the ranges
var idsCount = inputSpan.Count(',') + 1;
Span<IdRange> idRanges = stackalloc IdRange[idsCount];
var index = 0;
var maxDigits = 0;
foreach (var spanRange in inputSpan.Split(','))
{
var span = inputSpan[spanRange];
var separatorIndex = span.IndexOf('-');
var lowerBound = long.Parse(span[..separatorIndex]);
var upperBound = long.Parse(span[(separatorIndex + 1)..]);
idRanges[index] = new IdRange(lowerBound, upperBound);
index++;
// Also find the biggest number
var digitsCount = CountDigits((ulong) upperBound);
if (digitsCount > maxDigits)
{
maxDigits = digitsCount;
}
}
// For each possible invalid ID, check if it's in a range
var maxSingleId = 1L * (long) Math.Pow(10, Math.Ceiling(maxDigits / 2D)) - 1L;
for (var invalidIdSingle = 1L; invalidIdSingle <= maxSingleId; invalidIdSingle++)
{
// Build invalid ID
var invalidId = (invalidIdSingle * (long) Math.Pow(10, (int) Math.Log10(invalidIdSingle) + 1)) + invalidIdSingle;
// Check if invalid ID is in a range
// This could be optimized by building a sorted list of ranges and using binary search
foreach (var idRange in idRanges)
{
if (invalidId >= idRange.Lower && invalidId <= idRange.Upper)
{
sum += invalidId;
break;
}
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Sum of invalid IDs: [yellow]{sum}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var inputSpan = Input.AsSpan();
var sum = 0L;
// Parse the ranges
var idsCount = inputSpan.Count(',') + 1;
Span<IdRange> idRanges = stackalloc IdRange[idsCount];
var index = 0;
var maxDigits = 0;
foreach (var spanRange in inputSpan.Split(','))
{
var span = inputSpan[spanRange];
var separatorIndex = span.IndexOf('-');
var lowerBound = long.Parse(span[..separatorIndex]);
var upperBound = long.Parse(span[(separatorIndex + 1)..]);
idRanges[index] = new IdRange(lowerBound, upperBound);
index++;
// Also find the biggest number
var digitsCount = CountDigits((ulong) upperBound);
if (digitsCount > maxDigits)
{
maxDigits = digitsCount;
}
}
// For each possible invalid ID, check if it's in a range
Span<long> invalidIds = stackalloc long[maxDigits];
var visitedIds = new HashSet<long>();
var maxSingleId = 1L * (long) Math.Pow(10, Math.Ceiling(maxDigits / 2D)) - 1L;
for (var invalidIdSingle = 1L; invalidIdSingle <= maxSingleId; invalidIdSingle++)
{
// Build invalid IDs
var filledCount = FillPossibleInvalidIds(invalidIds, invalidIdSingle, maxDigits);
// Check if invalid ID is in a range
// This could be optimized by building a sorted list of ranges and using binary search
for (var i = 0; i < filledCount; i++)
{
var invalidId = invalidIds[i];
if (visitedIds.Add(invalidId))
{
foreach (var idRange in idRanges)
{
if (invalidId >= idRange.Lower && invalidId <= idRange.Upper)
{
sum += invalidId;
break;
}
}
}
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Sum of invalid IDs: [yellow]{sum}[/][/]");
}
return;
static int FillPossibleInvalidIds(Span<long> invalidIds, long invalidIdSingle, int maxDigits)
{
Span<char> idSpanBuffer = stackalloc char[20];
Span<char> target = stackalloc char[maxDigits];
// Write number to char span
invalidIdSingle.TryFormat(idSpanBuffer, out var idLength);
var idSpan = idSpanBuffer[..idLength];
// First part will always be the single id
idSpan.CopyTo(target);
var times = 2;
var index = 0;
while (true)
{
var targetSize = idSpan.Length * times;
// Check if result number would be too big
if (targetSize > target.Length)
{
break;
}
// Build concatenated string
for (var i = 1; i < times; i++)
{
idSpan.CopyTo(target[(idSpan.Length * i)..]);
}
invalidIds[index] = long.Parse(target[..targetSize]);
times++;
index++;
}
return index;
}
}
private record struct IdRange(long Lower, long Upper);
// Source: https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/FormattingHelpers.CountDigits.cs,b2bb39bb9360e1d1,references
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int CountDigits(ulong value)
{
// Map the log2(value) to a power of 10.
ReadOnlySpan<byte> log2ToPow10 =
[
1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5,
6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10,
10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15,
15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20
];
nint elementOffset = log2ToPow10[(int)ulong.Log2(value)];
// Read the associated power of 10.
ReadOnlySpan<ulong> powersOf10 =
[
0, // unused entry to avoid needing to subtract
0,
10,
100,
1000,
10000,
100000,
1000000,
10000000,
100000000,
1000000000,
10000000000,
100000000000,
1000000000000,
10000000000000,
100000000000000,
1000000000000000,
10000000000000000,
100000000000000000,
1000000000000000000,
10000000000000000000,
];
ulong powerOf10 = Unsafe.Add(ref MemoryMarshal.GetReference(powersOf10), elementOffset);
// Return the number of digits based on the power of 10, shifted by 1
// if it falls below the threshold.
int index = (int)elementOffset;
return index - (value < powerOf10 ? 1 : 0);
}
}

120
Days/Day3.cs Normal file
View File

@@ -0,0 +1,120 @@
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day3 : Day
{
public override int Number => 3;
public override string Name => "Lobby";
public override void RunPart1(bool display = true)
{
var totalOutputJoltage = 0L;
Span<int> bank = stackalloc int[100];
foreach (var line in Input.EnumerateLines())
{
// Parse the line into battery values
for (var i = 0; i < bank.Length; i++)
{
bank[i] = line[i] - '0';
}
// The first digit the joltage value will be the "left-most" biggest number we can find
var firstDigitMax = bank[0];
var firstDigitMaxIndex = 0;
for (var i = 1; i < bank.Length - 1; i++)
{
var batteryValue = bank[i];
if (batteryValue > firstDigitMax)
{
firstDigitMax = batteryValue;
firstDigitMaxIndex = i;
// We cannot have a digit bigger than 9
if (batteryValue is 9)
{
break;
}
}
}
// Now we can find the second digit which will be the biggest digit on the right of the first one
var secondDigitMax = bank[firstDigitMaxIndex + 1];
for (var i = firstDigitMaxIndex + 2; i < bank.Length; i++)
{
var batteryValue = bank[i];
if (batteryValue > secondDigitMax)
{
secondDigitMax = batteryValue;
if (batteryValue is 9)
{
break;
}
}
}
// Build the joltage value
totalOutputJoltage += firstDigitMax * 10 + secondDigitMax;
}
if (display)
{
AnsiConsole.MarkupLine($"[green]The total output joltage is: [yellow]{totalOutputJoltage}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var totalOutputJoltage = 0L;
Span<int> bank = stackalloc int[100];
foreach (var line in Input.EnumerateLines())
{
// Parse the line into battery values
for (var i = 0; i < bank.Length; i++)
{
bank[i] = line[i] - '0';
}
var maxIndex = -1;
for (var digitPosition = 11; digitPosition >= 0; digitPosition--)
{
// Next max is always on the right of previous one
maxIndex++;
// Find biggest battery value on the right
var max = bank[maxIndex];
for (var i = maxIndex + 1; i < bank.Length - digitPosition; i++)
{
var batteryValue = bank[i];
if (batteryValue > max)
{
maxIndex = i;
max = batteryValue;
// We cannot have a digit bigger than 9
if (batteryValue is 9)
{
break;
}
}
}
// Directly add its value to the total, we don't need to do compound sum
totalOutputJoltage += max * (long) Math.Pow(10, digitPosition);
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]The total output joltage is: [yellow]{totalOutputJoltage}[/][/]");
}
}
}

156
Days/Day4.cs Normal file
View File

@@ -0,0 +1,156 @@
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day4 : Day
{
public override int Number => 4;
public override string Name => "Printing Department";
public const int Length = 136;
public override void RunPart1(bool display = true)
{
var accessibleRollsOfPaper = 0;
var map = ParseMap(Input);
Span<(int i, int j)> adjacentPositions =
[
(-1, -1), (-1, 0), (-1, 1),
( 0, -1), ( 0, 1),
( 1, -1), ( 1, 0), ( 1, 1)
];
for (var i = 0; i < Length; i++)
{
for (var j = 0; j < Length; j++)
{
// There is no paper roll at position (i, j)
if (!map[i, j])
{
continue;
}
// Check if a paper roll is accessible
var adjacentRolls = 0;
foreach (var adjacentPosition in adjacentPositions)
{
var targetI = i + adjacentPosition.i;
var targetJ = j + adjacentPosition.j;
// Check that the adjacent position is not out of bounds
if (targetI is < 0 or >= Length || targetJ is < 0 or >= Length)
{
continue;
}
if (map[targetI, targetJ])
{
adjacentRolls++;
}
}
if (adjacentRolls < 4)
{
accessibleRollsOfPaper++;
}
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Accessible rolls of paper: [yellow]{accessibleRollsOfPaper}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var accessibleRollsOfPaper = 0;
var map = ParseMap(Input);
Span<(int i, int j)> adjacentPositions =
[
(-1, -1), (-1, 0), (-1, 1),
( 0, -1), ( 0, 1),
( 1, -1), ( 1, 0), ( 1, 1)
];
int removedRollsOfPaper;
// Loop until we cannot remove any roll anymore
do
{
removedRollsOfPaper = 0;
for (var i = 0; i < Length; i++)
{
for (var j = 0; j < Length; j++)
{
// There is no paper roll at position (i, j)
if (!map[i, j])
{
continue;
}
// Check if a paper roll is accessible
var adjacentRolls = 0;
foreach (var adjacentPosition in adjacentPositions)
{
var targetI = i + adjacentPosition.i;
var targetJ = j + adjacentPosition.j;
// Check that the adjacent position is not out of bounds
if (targetI is < 0 or >= Length || targetJ is < 0 or >= Length)
{
continue;
}
if (map[targetI, targetJ])
{
adjacentRolls++;
}
}
if (adjacentRolls < 4)
{
removedRollsOfPaper++;
// Remove roll of paper
map[i, j] = false;
}
}
}
accessibleRollsOfPaper += removedRollsOfPaper;
} while (removedRollsOfPaper > 0);
if (display)
{
AnsiConsole.MarkupLine($"[green]Accessible rolls of paper: [yellow]{accessibleRollsOfPaper}[/][/]");
}
}
private static bool[,] ParseMap(string input)
{
// Map is a square
var map = new bool[Length, Length];
var i = 0;
foreach (var line in input.EnumerateLines())
{
var j = 0;
foreach (var value in line)
{
map[i, j] = value is '@';
j++;
}
i++;
}
return map;
}
}

133
Days/Day5.cs Normal file
View File

@@ -0,0 +1,133 @@
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day5 : Day
{
public override int Number => 5;
public override string Name => "Cafeteria";
public override void RunPart1(bool display = true)
{
var freshIngredients = 0;
var idRanges = new List<IdRange>();
var readingRanges = true;
foreach (var line in Input.EnumerateLines())
{
// Read ranges
if (readingRanges)
{
// End of ranges
if (line.IsWhiteSpace())
{
readingRanges = false;
continue;
}
var rangeSeparatorIndex = line.IndexOf('-');
var lower = long.Parse(line[..rangeSeparatorIndex]);
var upper = long.Parse(line[(rangeSeparatorIndex + 1)..]);
idRanges.Add(new IdRange(lower, upper));
}
else
{
// Read ingredients
var ingredientId = long.Parse(line);
if (idRanges.Any(range => ingredientId >= range.Lower && ingredientId <= range.Upper))
{
freshIngredients++;
}
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Fresh ingredients count: [yellow]{freshIngredients}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var idRanges = new List<IdRange>();
var rangesToDelete = new List<IdRange>();
// Read ranges
foreach (var line in Input.EnumerateLines())
{
// End of ranges
if (line.IsWhiteSpace())
{
break;
}
var rangeSeparatorIndex = line.IndexOf('-');
var lower = long.Parse(line[..rangeSeparatorIndex]);
var upper = long.Parse(line[(rangeSeparatorIndex + 1)..]);
// Simplify ranges if there is overlap
rangesToDelete.Clear();
var skipRange = false;
foreach (var idRange in idRanges)
{
// Distinct
if (lower > idRange.Upper || upper < idRange.Lower)
{
continue;
}
// Outer overlap
if (lower >= idRange.Lower && upper <= idRange.Upper)
{
skipRange = true;
break;
}
// Inner overlap
if (lower <= idRange.Lower && upper >= idRange.Upper)
{
rangesToDelete.Add(idRange);
}
// Left overlap
if (lower >= idRange.Lower && lower <= idRange.Upper)
{
lower = idRange.Lower;
rangesToDelete.Add(idRange);
}
// Right overlap
if (upper >= idRange.Lower && upper <= idRange.Upper)
{
upper = idRange.Upper;
rangesToDelete.Add(idRange);
}
}
if (!skipRange)
{
foreach (var idRange in rangesToDelete)
{
idRanges.Remove(idRange);
}
idRanges.Add(new IdRange(lower, upper));
}
}
var freshIngredients = idRanges.Sum(range => (range.Upper - range.Lower) + 1);
if (display)
{
AnsiConsole.MarkupLine($"[green]Fresh ingredients count: [yellow]{freshIngredients}[/][/]");
}
}
private record struct IdRange(long Lower, long Upper);
}

209
Days/Day6.cs Normal file
View File

@@ -0,0 +1,209 @@
using System.Buffers;
using System.Numerics;
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day6 : Day
{
public override int Number => 6;
public override string Name => "Trash Compactor";
private static SearchValues<char> DigitsSearchValue = SearchValues.Create(
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
);
public override void RunPart1(bool display = true)
{
long grandTotal = 0;
var numberRows = new List<List<long>>(4);
var symbolRow = new List<char>();
var rowIndex = 0;
foreach (var line in Input.EnumerateLines())
{
if (rowIndex <= 3)
{
numberRows.Add([]);
}
foreach (var range in line.Split(' '))
{
var span = line[range];
// Ignore split columns
if (span.IsWhiteSpace())
{
continue;
}
// Numbers
if (rowIndex <= 3)
{
numberRows[rowIndex].Add(int.Parse(span));
}
// Symbols
else
{
symbolRow.Add(span.Trim()[0]);
}
}
rowIndex++;
}
// Do the calculations
var count = numberRows[0].Count;
for (var i = 0; i < count; i++)
{
checked
{
grandTotal += symbolRow[i] switch
{
'+' => numberRows[0][i] + numberRows[1][i] + numberRows[2][i] + numberRows[3][i],
'*' => numberRows[0][i] * numberRows[1][i] * numberRows[2][i] * numberRows[3][i],
_ => throw new ArgumentOutOfRangeException()
};
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]The grand total is: [yellow]{grandTotal}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
long grandTotal = 0L;
var numberRows = new List<List<long>>(4);
var symbolRow = new List<char>();
var lines = Input.Split(Environment.NewLine);
for (var i = 0; i < 4; i++)
{
numberRows.Add([]);
}
var offset = 0;
while (offset < lines[0].Length)
{
// Find offset at which the next set of numbers stop
var numbersEnd = offset + 1;
var foundSpaceColumn = false;
while (!foundSpaceColumn)
{
foreach (var line in lines)
{
// If any line does not contain a space, we can go next offset
if (line[numbersEnd] is not ' ')
{
numbersEnd++;
foundSpaceColumn = false;
break;
}
foundSpaceColumn = true;
}
}
for (var i = 0; i < numberRows.Count; i++)
{
var span = lines[i].AsSpan()[offset..numbersEnd];
// Parse number with correct offset
var lastPaddingIndex = span.LastIndexOfAnyExcept(DigitsSearchValue);
var lastDigitIndex = span.LastIndexOfAny(DigitsSearchValue);
if (lastPaddingIndex > lastDigitIndex)
{
numberRows[i].Add(long.Parse(span) * (int)Math.Pow(10, lastPaddingIndex - lastDigitIndex));
}
else
{
numberRows[i].Add(long.Parse(span));
}
}
// Also get the symbol
symbolRow.Add(lines[4][offset]);
// Next pack of numbers starts after the space column
offset = numbersEnd + 1;
}
// Do the calculations
Span<long> numbersBuffer = stackalloc long[4];
var count = numberRows[0].Count;
for (var i = 0; i < count; i++)
{
numbersBuffer[0] = numberRows[0][i];
numbersBuffer[1] = numberRows[1][i];
numbersBuffer[2] = numberRows[2][i];
numbersBuffer[3] = numberRows[3][i];
NumbersToRtl(numbersBuffer);
grandTotal += symbolRow[i] switch
{
'+' => numbersBuffer[0] + numbersBuffer[1] + numbersBuffer[2] + numbersBuffer[3],
'*' => ValueOrIdentity(numbersBuffer[0]) * ValueOrIdentity(numbersBuffer[1]) * ValueOrIdentity(numbersBuffer[2]) * ValueOrIdentity(numbersBuffer[3]),
_ => throw new ArgumentOutOfRangeException()
};
}
if (display)
{
AnsiConsole.MarkupLine($"[green]The grand total is: [yellow]{grandTotal}[/][/]");
}
return;
void NumbersToRtl(Span<long> numbers)
{
Span<char> number0 = stackalloc char[4];
Span<char> number1 = stackalloc char[4];
Span<char> number2 = stackalloc char[4];
Span<char> number3 = stackalloc char[4];
numbers[0].TryFormat(number0, out _, "D4");
numbers[1].TryFormat(number1, out _, "D4");
numbers[2].TryFormat(number2, out _, "D4");
numbers[3].TryFormat(number3, out _, "D4");
// Reconstruct numbers
for (var i = 0; i < 4; i++)
{
var number = 0;
if (number0[i] - '0' is not 0 and var digit0)
{
number = digit0;
}
if (number1[i] - '0' is not 0 and var digit1)
{
number = (number * 10) + digit1;
}
if (number2[i] - '0' is not 0 and var digit2)
{
number = (number * 10) + digit2;
}
if (number3[i] - '0' is not 0 and var digit3)
{
number = (number * 10) + digit3;
}
numbers[i] = number;
}
}
long ValueOrIdentity(long value) => value is 0
? 1
: value;
}
}

175
Days/Day7.cs Normal file
View File

@@ -0,0 +1,175 @@
using System.Buffers;
using System.Numerics;
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day7 : Day
{
public override int Number => 7;
public override string Name => "Laboratories";
public const int Width = 141;
public const int Height = 142;
public override void RunPart1(bool display = true)
{
var splitCount = 0;
var splittersMap = ParseSplittersMap(Input, out var startPosition);
var beams = new HashSet<Position>();
var nextLineBeams = new List<Position>();
var usedSplitters = new HashSet<Position>();
beams.Add(startPosition with { I = startPosition.I + 1 });
// Simulate beams going down
var row = 1;
while (row < Height - 1)
{
foreach (var beamPosition in beams)
{
var targetPosition = beamPosition with { I = beamPosition.I + 1 };
// There is nothing below
if (!splittersMap[targetPosition.I, targetPosition.J])
{
nextLineBeams.Add(targetPosition);
}
// There is a splitter, only counts it if not already used
else if (usedSplitters.Add(targetPosition))
{
splitCount++;
// Left and right beam
if (targetPosition.J - 1 >= 0)
{
nextLineBeams.Add(targetPosition with { J = targetPosition.J - 1 });
}
if (targetPosition.J + 1 < Width)
{
nextLineBeams.Add(targetPosition with { J = targetPosition.J + 1 });
}
}
}
// Always delete current line beams since we iterate from top to bottom
beams.Clear();
foreach (var nextLineBeam in nextLineBeams)
{
beams.Add(nextLineBeam);
}
nextLineBeams.Clear();
// Also clear the used splitters list for next line
usedSplitters.Clear();
row++;
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Beam split count: [yellow]{splitCount}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var splittersMap = ParseSplittersMap(Input, out var startPosition);
var quantumPositions = new Dictionary<Position, long>();
var nextQuantumPositions = new Dictionary<Position, long>();
quantumPositions.Add(startPosition with { I = startPosition.I + 1 }, 1L);
// Simulate beams going down for each timeline
var row = 1;
while (row < Height - 1)
{
// Simulation step
foreach (var (beamPosition, timelinesCount) in quantumPositions)
{
var targetPosition = beamPosition with { I = beamPosition.I + 1 };
// There is nothing below, keep going down
if (!splittersMap[targetPosition.I, targetPosition.J])
{
UpdateTimelines(nextQuantumPositions, targetPosition, timelinesCount);
}
else
{
// Left and right beams
var leftBeamPosition = targetPosition with { J = targetPosition.J - 1 };
var rightBeamPosition = targetPosition with { J = targetPosition.J + 1 };
UpdateTimelines(nextQuantumPositions, leftBeamPosition, timelinesCount);
UpdateTimelines(nextQuantumPositions, rightBeamPosition, timelinesCount);
}
}
// Always delete current line beams since we iterate from top to bottom
quantumPositions.Clear();
foreach (var nextQuantumPosition in nextQuantumPositions)
{
quantumPositions.Add(nextQuantumPosition.Key, nextQuantumPosition.Value);
}
nextQuantumPositions.Clear();
row++;
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Timelines count: [yellow]{quantumPositions.Sum(p => p.Value)}[/][/]");
}
return;
// Update and merge timelines
static void UpdateTimelines(Dictionary<Position, long> nextQuantumPositions, Position targetPosition, long timelinesCount)
{
// Merge timelines if there is already one for this target position
if (nextQuantumPositions.TryGetValue(targetPosition, out var otherTimelinesCount))
{
nextQuantumPositions[targetPosition] = otherTimelinesCount + timelinesCount;
}
// No timelines to merge, no new timeline
else
{
nextQuantumPositions[targetPosition] = timelinesCount;
}
}
}
private static bool[,] ParseSplittersMap(string input, out Position startPosition)
{
var map = new bool[Height, Width];
startPosition = new Position(0, 0);
var i = 0;
foreach (var line in input.EnumerateLines())
{
var j = 0;
foreach (var symbol in line)
{
// Find start
if (symbol is 'S')
{
startPosition = new Position(i, j);
continue;
}
map[i, j] = symbol is '^';
j++;
}
i++;
}
return map;
}
private record Position(int I, int J);
}

221
Days/Day8.cs Normal file
View File

@@ -0,0 +1,221 @@
using System.Buffers;
using System.Numerics;
using Spectre.Console;
namespace AdventOfCode.Days;
public class Day8 : Day
{
public override int Number => 8;
public override string Name => "Playground";
public override void RunPart1(bool display = true)
{
var boxPositions = ParseBoxPositions(Input);
var boxPairDistances = FetchOrderedDistances(boxPositions);
var circuits = new List<HashSet<Box>>();
var connectionsCount = 0;
while (connectionsCount < 1000)
{
// Fetch next minimal distance pair. This is always the last pair in our ordered list
var (pairLeftBox, pairRightBox, _) = boxPairDistances[^1];
boxPairDistances.RemoveAt(boxPairDistances.Count - 1);
// Create a connection if those two boxes are not already connected
if (!ConnectionExists(circuits, pairLeftBox, pairRightBox))
{
// Connect the boxes, eventually merging circuits
ConnectBoxes(circuits, pairLeftBox, pairRightBox);
}
connectionsCount++;
}
var result = circuits
.OrderByDescending(circuit => circuit.Count)
.Take(3)
.Aggregate(1, (product, circuit) => product * circuit.Count);
if (display)
{
AnsiConsole.MarkupLine($"[green]Result is: [yellow]{result}[/][/]");
}
}
public override void RunPart2(bool display = true)
{
var boxPositions = ParseBoxPositions(Input);
var boxPairDistances = FetchOrderedDistances(boxPositions);
var circuits = new List<HashSet<Box>>();
long result;
while (true)
{
// Fetch next minimal distance pair. This is always the last pair in our ordered list
var (pairLeftBox, pairRightBox, _) = boxPairDistances[^1];
boxPairDistances.RemoveAt(boxPairDistances.Count - 1);
// Create a connection if those two boxes are not already connected
if (!ConnectionExists(circuits, pairLeftBox, pairRightBox))
{
// Connect the boxes, eventually merging circuits
ConnectBoxes(circuits, pairLeftBox, pairRightBox);
}
// Check if there is a circuit with all boxes connected
if (circuits[0].Count >= 1000)
{
result = pairLeftBox.X * pairRightBox.X;
break;
}
}
if (display)
{
AnsiConsole.MarkupLine($"[green]Result is: [yellow]{result}[/][/]");
}
}
private static double BoxDistance(Box left, Box right)
{
return Math.Sqrt(
(right.X - left.X) * (right.X - left.X) +
(right.Y - left.Y) * (right.Y - left.Y) +
(right.Z - left.Z) * (right.Z - left.Z)
);
}
static bool ConnectionExists(List<HashSet<Box>> circuits, Box left, Box right)
{
foreach (var circuit in circuits)
{
if (circuit.Contains(left) && circuit.Contains(right))
{
return true;
}
}
return false;
}
static void ConnectBoxes(List<HashSet<Box>> circuits, Box pairLeftBox, Box pairRightBox)
{
// Try to find circuit containing each box
HashSet<Box>? leftCircuit = null;
HashSet<Box>? rightCircuit = null;
foreach (var circuit in circuits)
{
if (circuit.Contains(pairLeftBox))
{
leftCircuit = circuit;
}
if (circuit.Contains(pairRightBox))
{
rightCircuit = circuit;
}
}
// None is in a circuit, create a new one
if (leftCircuit is null && rightCircuit is null)
{
var circuit = new HashSet<Box>
{
pairLeftBox,
pairRightBox
};
circuits.Add(circuit);
}
// One of the two is null
else if (leftCircuit is not null && rightCircuit is null)
{
leftCircuit.Add(pairRightBox);
}
else if (leftCircuit is null && rightCircuit is not null)
{
rightCircuit.Add(pairLeftBox);
}
// Both are already in a circuit, merge them
else
{
foreach (var box in rightCircuit!)
{
leftCircuit!.Add(box);
}
circuits.Remove(rightCircuit);
}
}
private static List<Box> ParseBoxPositions(string input)
{
var positions = new List<Box>();
foreach (var line in input.EnumerateLines())
{
var split = line.Split(',');
split.MoveNext();
var x = long.Parse(line[split.Current]);
split.MoveNext();
var y = long.Parse(line[split.Current]);
split.MoveNext();
var z = long.Parse(line[split.Current]);
positions.Add(new Box(x, y, z));
}
return positions;
}
private static List<BoxPairDistance> FetchOrderedDistances(List<Box> boxes)
{
var boxPairDistances = new List<BoxPairDistance>();
for (var i = 0; i < boxes.Count - 1; i++)
{
for (var j = i + 1; j < boxes.Count; j++)
{
var leftBox = boxes[i];
var rightBox = boxes[j];
var distance = BoxDistance(leftBox, rightBox);
boxPairDistances.Add(new BoxPairDistance(leftBox, rightBox, distance));
}
}
// Sort in reverse order
boxPairDistances.Sort((left, right) => right.CompareTo(left));
return boxPairDistances;
}
private record Box(long X, long Y, long Z);
private record BoxPairDistance(Box Left, Box Right, double Distance) : IComparable<BoxPairDistance>
{
public int CompareTo(BoxPairDistance? other)
{
if (ReferenceEquals(this, other))
{
return 0;
}
if (other is null)
{
return 1;
}
return Distance.CompareTo(other.Distance);
}
}
}

File diff suppressed because it is too large Load Diff

1
Inputs/Day2.txt Normal file
View File

@@ -0,0 +1 @@
6161588270-6161664791,128091420-128157776,306-494,510-1079,10977-20613,64552-123011,33-46,28076-52796,371150-418737,691122-766624,115-221,7426210-7504719,819350-954677,7713444-7877541,63622006-63661895,1370-1981,538116-596342,5371-8580,8850407-8965070,156363-325896,47-86,452615-473272,2012-4265,73181182-73335464,1102265-1119187,3343315615-3343342551,8388258268-8388317065,632952-689504,3-22,988344-1007943

200
Inputs/Day3.txt Normal file
View File

@@ -0,0 +1,200 @@
2232212212212222211221231124224222213132222133122224222123222112324122222122221322222225222342243112
2222312114222314322223142323251122424322142244122212213222222222242526225232262212234353242222112242
3325444446453345434534234244443254434533443354443344424431124344542134454433534353443542455544444483
2334235313232232645234524223233333333323323333233334323332325633143222333322242333132233233132212325
2234311224123424222222224432222333212224412234223312244413252153222112433222334322772215422121224273
4522445145543645454343253542221455532354534564325445322522535254222337733425252243221532745237255133
2214225223121214462323123283942523226421423233325342644222213411423272383842222442422213122912324522
2122242232325524322242212232524425223232232233432221122322233512432222441122422314222122221222212225
8222353391373332335354222456125222358233122233316323355352531234333527222223352436381343533536331244
2127632636444323427265228625582625772229446462233352433587748742382622354425852874557228522772714265
5764566853423796763449339447557566366572334553648326634466376656683936736543746865667784426952852681
2121232232222322211232122232213212117222223222221652221222212242222222222333321322222222222122522223
3311487326434675433324437437335526732665253343574234535363333477334461753847265314545424442324747728
6252536321432743472244167342323675732726575412571775613245775732227775657226312524123527567671676189
7533722333717216436553422342221352632923463174227273634221314835124324462631282462922324654573644336
3334347211322211322233222241233221232124212322322224423224253425525344442212222284312232222324322414
8767635775767537537775596426945666564695551577422716939227657554649562833366674365266155727577774737
7775767466374676353856676436275545371656656638858776373448786645468766554726777677755355577244574383
4124457552243552342355664445373255223422339335535644524442445657442153557545543453354343433643267753
6124333457242323425527522653254242224232423232264274434422411227635523364224422236253335315116127532
3843363244543644643446444336332633352434545244436626634545444448444432343456656564456736353434435763
2422221722221518823422211232528222221322741422521112323225722252542221222152231123242126243222522576
1622233224223242225223226253345331335142347122554523313243535325924223222222332241922222221423233121
4422161223245313242212152356523252352332114532131212331132322223662325121132255222245126112324622222
4233231332312314222233333341133332452443423443134344332243234243444423443533423343333244354382332434
6412258431772524433228362126666441227873942928375972932224772779977239924896932962725678357742792757
2227271234224232322222332222221223242222336232222321222123332221232363322222123232311223225321123324
7589939488935898867996484599788786867736849995938599889798476788896676459989897766888896597487889955
3454654452545325445345241613354242541353364444436354434433222254535434343434244433352454491236544424
3555422223544453332243232524152235232432234321322225424353448233244453333633454744244242322633235544
2124222224441239425244322954112523572245362622825554225282222736532822246252222222625122321847223735
3236336542322621344455252325253252236337264153213264532252332554223524342132622262555624217132225523
2526592122123332422822131141234342452222223213126221224262242336444543224251621223527425633635432422
4627434275335624743842223367643372773416353388754337724725344333445735354575952356357743428124523423
5131323342333323332333223333231343333533322133333351233343323326353222332223323323355332223125436611
3267823353225414622752883222125222822288682231242712212212222312622262222232262239152212766233622742
3233632122333233633333333331713131221283512363322533235333333353253232423232232312332336353232511333
7537335633333332333257451533743636333336344234383233638333825643833324862326234334536343333337341534
7374226635593315434733244453342226646737436272495334563847314623624832636243233334512322529283445263
4332232521223522524213221234143433214242236352238234234145322342235343223263631624558153124433322263
2522212625442322522232213336422222244225234213335226232232544223291312422512225122122152452522284222
3223121222448242222232124324212222232372344252326235832228322247122222322232422122282212222221222334
3532267229665572922222236676865635148363573285411561725352232854345323542463955323228643283411566268
3357562156445382573453552434624343344555753334452344275353435433233343545435554553531442333343545323
4432285342325163234221332435222123365325322323334325472242261325439248524244352229353255664624222332
5431252222458374243642592224346445254352332235374424452555534438625129442442434335415312335582323233
4323424443537342215451244432322222322262445334343422342225131243343242422312542126413331246233333414
4364214533233224324343345333333332333523353333324214315243433333323413413343433343343135333312343333
3223134252331264234231223413332384833323311111472333258232326331233453222123283532162132322222213123
2122322222222332222212412222421222212222335322222123213121232223222355331222241212232223222122212222
2224234336222923229631122212222612332523531322272232233123322223442324123313256323423442722216232512
3333324326462443643324233235432334632354333323332336163232334253342523333223351246225324332353535564
2652435323434322222223325242213225213233122223236242225241342232234132526222345232157223522552124332
3411222222226222221122322113222221223126312216224221122212222122242222222312122212727221212242231221
4456532435443334732561536454334463553353556454575452634335511435653443333455255235435445465545553134
2228332566243332533533252323335332231316214213243333232133434226343943323352214232213322333433335212
3365426738758286223813946783465373375236837736556379353363573387385397747575645375432373453243373298
2374464353232333237353476246233321127232426742236472547323234324246433373336253442412444322493272472
3433823214282232422432246132534272631326662712841823232362422314263262437186423322512121721222764782
2212221325332253132322215232314222142112221124222235222233333213232243132233223322232175233332233222
1322232332221132111122231322312233222432221422243222233423433133225222224321322322323233327224222232
1646353222222366621126365622131123313224423236214524422434321352522352211643433222432424454255232342
3361246654224456345614565445236613412443442534524666655261365666531522166125553226265651516625126789
4324334643744332474343444449444636345744136484654443344354443433464531343444454463434747785437245447
5452122332323323125222212232221332222222222222222231232312182222123242331122112231122421221323232422
2211251211252222622253221332252222212922232222322322221222422124228552222312622122221221222212274322
6312233221334343211331335223232235222532314222232223323423323343132222221133225123323476243233223114
6365746667644366678673776345675677645664653459445634735635562465556549961355736666746565734664645547
3221223222222332212221322122324222122122122211112214222322122122222121222222112112232222231433222122
1422361231254154455327225426522633323223321223545452553224325226628412212635854242361124447216543452
3666233524341323332235392765343263455725455245627253316134426537127422852162423422242634754221114822
3932433363332433232333726333333322334331332636223844223125733237523322343253323322253713213222333332
4493744344343834344443452343336344428436454332433425458644535434483442554494443454624254346454444533
5699934925565955456654646643377577254475687546547848667996565655157229655448156642565884755556349397
2412344544333346124443433363233223333343333344336734136233423334433433343143232333143233365933334343
1629643246222715451822963326475635412213424375224242216415646222713289214241172435222575212224121736
2252522432412549512366312275222222373242325416522265412221721226556221122252235273275426642122427522
1413222233624135145593211616522426244254844452521552272422254536455622433271358325522434313343224463
3224423212432442132244433242415322342232432332224213224242231424233421323324222242444232222443422223
3422233231433314333231233333233333333423333433332331343321233243133333323331342324322433343233423333
4245333537332234633432342332323328332232224343333343334353514454433722242233353641212333285343631332
5223226432542535334272221623443313523443252332624714433827453354551322323276223543323322425214216561
9797352317238959996855458878658559627886527272323796576749782735857222478979158267967842734532637298
2233315472222233225323231342221225322534411322222222252221323222211243442321411412233132323235245223
3242242512222224434221246355113123221214231222336222222262323212273222434232324213712221324222532544
5232232112233212221222742221224212221222222132222221222213222521351152131361223222222221231121122122
2322322121321222222221241222222222222221211222223124142212222222123212322212222122222421122222252222
4334454542453614443324434444464344564545444424444454554444454443434343364344354444434442344253434444
2212322523313311222122522623343141322313342331212442222412224524322223244452231316412252262323322222
2222212272212222122122222522113122242221222222222212222224122222221222122221224121212222212212412221
2262337146893946174873662226535147545374544263382266265526568543452839587616544643126292665282936624
3632252333332333333443223232262335313333233332314333343233345243313243233365363313235323332251334333
3221232222222231322523223221226228231232223121521222423642122221212222322222122223241211231231323322
2221222222211221222321222222321111241222212221223224222111226222222222127221122321122322222222223222
6124144523332424733744135412344413421242123443515845332333352381548533242422427444334537433335322574
7453758454284755866546827436558875877536562985475866626748436685734445624337877296528474836188782753
5725733623574543384332644163741436413538624353353125322413732535252354534676342533233443636764346533
3724543433444425433433334324347463344832345544343464234456334442253444343934444232343544352344734343
6573566365455442255555524262564564545162457584866572865548453564655536755528442528355355335274452555
3222221223313472322312322223112362322312222112321321222323333422212221332242211232332234312422322226
6684364344445364343623423527355342443365534744737476345423442431424363432387333644234536114334313743
3233322323622333233224331231516231133322322232233222222232342523213345323243332215613222522443353132
5233232142321234421331321222222312221211123133132324142229222222223223232222223422232222224362224341
1623812226295322222452341223423224244822222244262222226522254322222354323823234622623342833422134243
8333332232332233233122333321222322323322223212332226112423223216223222223321223122433232322322133323
1445455125545213412322444525223256423451342852266534614222242224134464414322623543351274434232725426
5573546354364544548532342646434444554247464434444334464533335544555447424544744345433465422444335345
4562565676457555226566266835565649635546563647665517725942797526353315545955559436375764268749645898
6575389545666586355556557655258454466366756659655667656556582566555465559455532256575635466765755551
2522372325223285372377443342324824613332232726232122334317271432643232352312841322424762333233395233
2325212222222422242642232311222421214211222221222214422221222242131222122222521362214232321222124221
3443334344363536646652475343315326533663446343345554247337628331336572334445334673738533443665543342
2132212222231122223244212212222212228222233272341222122222242352251212322325222212211922122624222222
9575468865546956387974456933636335313545532835783785683744589494443434344565445464834553577825488995
2232221523232232222252336212562321222122411723311522222422216223221222621222176222222111614122221252
2411324543243436234332382332234214435321523422313323444432433242322423134133444241124142332331234444
3433433334352343225433321342331324334324436434454253433254434433232322423433335424444433233323343334
3223422232335211433544355441333533324324224521343345431633342323623234437234243141342447733332355443
2411332212121252533343422283442212322133324233124822321255297222331282432222722222422225234551324542
1212122312232223236244132211522422335231321321233311413522332233123232243232312123322221522432333223
7334732333343334432153322533242333342334333433542333323344232343333631333134333324341334323332233321
4223522232212222331134221222522114354221215211122143472242233151322215324333435221222111222125242222
3222333222332132352223221213322232222113211132322232323223262222322232231433522222332222122315322222
4241254433142142123222423422312231234332242212342422234142423232314242344322144224343422223212435253
4435124394543415434351654321444434453344533554424428337244554533353443435545332645235353543553624434
4953545494325476235384273555532639985727583622585542734352939855234464949436494654347624427975335752
1232253544413221381621112135437813322644122432322123133243121211252322135345213422232223825116322142
7176762571577351467326138773541464454587645184235842236622256247346688118431458431258687874365414659
2234232222222322322227532122582522122332422321222223222212152215325222223321221223223281421221322272
2425383136529333525526333212772263633723248433642255323553412633172463436577851421236523265744234522
3424262253652335642215242324645354215251762247525283223142532441334534261222436332322215452368293294
3525625641636442423534235631325866434443266454611324526226469346631344363145685421462455233735624345
5276763684237376172166382633667247437378333539246423364394367744953897395676234326742766684349243562
4233422424444222242434315214323442396243233222224442344444422342234344623323212323224426342442427234
2455654832635651757551426372442144653642514347558494583127222312332291665422754344255247559626765126
2423243424113222233244222221234543212222174224434222112321343222222321212333423144422255222222413122
3323333236543227312763323323522323831924221328237333782233235623233343431243535322223335382353122133
2642453233833326882633337743646383422483273534435314347233322527835732448264631373443364128368335834
6321247133126761767527423261476422264542629276752248335262214216629211627473621659671535368222612669
5343777868459585575482665644767666773655757774767864755776477544456869665597555737746565466765544456
1561262334141223245665535412224136232446722652331362425423161246335221246455132554556132262625222555
5725416122222431321214232245422252241221232124234422112421223522241233231222223232253322412111224464
1342634245353479774636277557464349166649866286327455463463636677272756383566156564766367664434525544
2222214123614223121322332318514242112223523113141382142232142142233231421222362222233262322213343743
6232323432322254643333225193233343333423321243245225332132242323632264522322336122232231212351212223
3134444244333433225323244553224323233233323334332322233334131123434334332263343643354324333333333333
5532268321431422223343232322352234537313226334376242424454322432374463252213326577332252837226334641
5454844649566486677668957445459426468556946465673647773845366434343566647393767866654877854729566655
2422261322545145375223322644442555224434132222357432123332514282554322645316424122242235533345325354
3453712694444284286643414431362435383471343775542345353323626357143668234121858535252933816335326432
2692252814322492259236385535955522425425223342262252322174535732822419432644742213257343242222582643
6224333313434321343237423443742234422322332352563424433343233254324214252234443222233353343243333445
4341454432233455223475433475834433424452531334443432434434543434324144237344441424343324333441646255
7434464744476424675745843545587323486545535756479535344455254523223337565676533355416635334549535976
3553356443855549413244624436535286254385433334226234338534135565231251535244343542565554226235635334
6573451149567373447735352333764555854832677437453435454465844374557267983453554498384334844362354649
3222254452422632224342325232542722451421242426521244243425424432222231324222222222222224444132543462
2122421222232412322232411222341132211222815512622251621622322425233342126123321222212233532357222222
2212232521412331133232455327233262332232323333233232141422322434333231222732323462221323232213222211
3232332221511232236313222373234232352363332233522423133221423342323322222133322133333332222243322362
2336422223291359222423422723843312323142222422352222453222313423325226423333532343317321422225321142
4343335344372513234535342343343331535336323543354634443324332253537437441345145433453334416434323352
3237453244334333332544534453434432432453435333343236534453223333433262234443423444431235133845232333
6456227863763242255472623627231646622542245446515545363156162236672662444622442685215534225266296642
2221332422312223552533253124222143223432222123213232331623267323322312232362544423433242224434255212
6223465529466236233843281262333513534533347144636335524465365425322223373826446133535333335936553663
2422522232222332132222436342244222212125223234334411321232322424384243222245362244243432424231222224
2455326555464433825522411753425666565575612655266536636523455355543744564462384354365164425355735543
2222222223222222111222222222212213221233232222222332113222221222262222132221221212122223112222122132
3757772733244484433471354299755673837533632373346333735764325326263332933364634336225349447642767347
6437333932233533335653243853723337632339355633363334344352325433234631533434522225121233842335623366
1522322353333243423526152523222341222216322522631222136252125432232222422232211222322636312253262237
3244925232233442334453242444241423433222233234323483133314262243244121333332323242321254222333333331
2353223342323312327232322421224232123221132271242314335221333242245322142323223222134422332222223313
2232223222152322222221221121232212124133322431112342321232222222321222211232233311232221222232222123
3453545474334436473443566463435375435867524354646246572375445332562455654454447265633425553447415546
8325538754433525383334434495321546255334334349823332443333244294334243537453573399238389554251532513
7656246667563266466285456546456634856666957366663567458366756667648824545698465586644656686567376793
4215351543432113323415311324225123133123142113334411255112542454441323515215512232515424352535536789
1111223223122222222212222222222121222121222222225422222222212322222222233211242234122121222221222213
5678874659337973585843437281459576744742867132948467828423979842756986437335768649266634535646384756
3321432323333214232334221532121112433224263223323333735223333142518214311333551312233337431332222331
3221122322355421122222453222425223221222442312325124432242254223232322354422311511222231212225272322
3326243721153143233313222221442134142337593334337525233226413533524382451233373863723253915332223322
4323922223241324233114233242234372243132523323224232522234672222932332123232522413335233242223326132
4322523121353121333322532434134233233114242224344533323351233542365523264233431435614923234534264343
2413439321538222312223262451523242222223422221322414424312213143162222233225243213124234222242234342
3342122215245575225214522336225122222452225452142422442322242424233553522122474675551126222332423412
2233212232112143223212212231131212212233232223222231322122222122333332123123222222332132432232232322
3123343334341232234231322243134412132113314413424131312441443333224114142441423243344314242144456789
5385554234435342844722553342162686427245123565484553455665282646565214247314425653986444256446243726
1423322322142322343222211212322232222242323233132433232122324221321213111311232212131253212246222322
2251232221222126122123211222231232221222262212221122111222221232222322212212212223221222222222222242
4433211425222435344223312275476734164333243421521257332731712552245523223432413345313534272123232531
5374861454518743534536288564523325333536745576255527655233661778769564756756829149877383953443336824
3313122322343331253323335333343224231126233223221243331333312332333332332332233322123323223253233333
4413524351244212524255443427242452242444414252125243353241535255256425423353123331432285522243215864
4233233624553534233334344223842653442554363333343434314464443234333354472933333443314632434634254324
3553898859594653737688866779538897656477718999867897996545698835748668695853929454638293454775739576
3616433333424364342231322772322273742562435322524343222733733633315231217432253332344435423437477333

136
Inputs/Day4.txt Normal file
View File

@@ -0,0 +1,136 @@
@..@@.@@.@@@@@....@.@@.....@@@@.@.@@@@@.@.@.@@@@@@@@...@@..@..@@.@@@..@.@@@@.@@@@.@..@@....@.@.@.@@@...@@@.@@...@@..@@@..@@.@@.@..@.@@@.
@@@..@@@.@@@@@@@@@@..@@.@@@.@@@@@@@@@..@.@@@@....@.@.@@@@.@@@@.@@.@@.@@@.@.@@@.@@...@@@@.@@@@@@@@@@@.@@@@@@@@@@.@@@@@@@.@@@@..@@@@@...@.
@.@@@@..@@@@@....@@@@@@..@@@.@..@.@.@@@.@@..@.@.@@@.@@.@@@@@@@.@@@..@@@@@..@.@@.@@.@.@.@@.@.@@.@@@@@@@@.@@@@@@.@.@@.@@.@@@@..@.@@@@@...@
@@@@@@@.@.@@@.@.@@@.@.@@@.@@.@@...@@@@@.@.@.@@@.....@@.@@@@.@@@.@.@.@@@@@@.@@@@@.@@@@.@..@@.@@@@@.@@.@@@@.@.@@@@@@@.@@@@.@@@@@@.@.@@@.@.
@.@@@@.@@@.@@@..@...@@@@..@..@..@@@@....@@@@.@@@@@@@.@.@@@.@@@@..@@@@..@@...@.@@@@@@@@@@@@@@@.....@@...@@@.@.@@...@@@..@@.@@@@@@@@..@@..
@@@@.@..@@@@..@@...@.@..@@@.@@..@@@@@...@@@.@@@.@....@.@.@.@@..@@..@..@@.@@@...@@@...@@@@....@@@..@..@....@@......@@..@@..@@@@@@..@@.@@.
.@@@@.@@@@.@@.@@@.@.@@@@@@.@..@@..@@@@.@@.@@..@.@@.@..@@@@@@.@@.@@@..@.@@....@@@@@.@@..@..@.@@@@.@....@@@.@....@.@@@@@@@@@@.@.@@@@...@@@
@.@@...@.@@@.@.@.@@.@@@@@..@.@@@@@.@@.@@@.@..@@@@..@.@@@..@@@@.@@.@.@@.@@.@@.@.@.@@@@@@@@@.@@@@.@@@@@@.@...@..@..@@.@@.@@@@@@@@@.@.@..@@
@..@.@.@@.@@@@@@@@@@@@..@@..@@.@@@..@@@.@..@@...@.@.@@.@@..@..@@@@.@@@.@@@@.@..@.@..@@@@@@.@.@@.@@@@.@..@@@@@.@@@..@@....@@@.@@.@.@@@...
@@.@@@@.@..@@.@.@.@@.@@@..@@..@@@@@..@@.@.@@@@@..@..@.....@...@@@@@@@@@@..@@@@@@@@.@@@.@..@@@@@@@.@@......@@@...@...@...@@@.@.@.@@@@@@@@
@@@@@....@@@@@.@@.@@@@@@..@.@.@...@@@@@.@.@@@@........@.@.@@@@.@..@@@@..@@@@.@@.@@@.@...@@@@@@..@@@@@@.@@@@@@.@.@..@@@@...@@.@@...@..@.@
.@@@@@@@@@.@..@@@..@@@@@@@@.....@..@@@@@@.@...@.@@@@@.@.@@@.@.@@@@.@.@.@.@..@.@@@.@@@@..@.@..@@@@@@@@@@@@..@@@.@.@@@@@@@@@.@..@.@.@@@@@@
@@@@@@@@...@@.@@.@@@@..@@@.@@@@@@@@@@.@@@..@@@.@@@..@@..@..@@@@.@.@.@@@@.@@....@@@@.@.@.@@@@@@.@@@@..@@@.@@@.@@@..@@@@.....@@.@..@.@@.@@
@.@.@@@@....@....@@@@@@@.@@@.@.@@@@@.@.@..@@@.@@@@@.@@@@..@@.....@@@@.@@.@@@..@.@@...@@@.@@.@@@@.@.@@@.@@...@@@.@@@..@..@@@..@@.@@..@@@.
@.@@@@@@...@.@@@@@@@..@..@@.@@.@.@..@@.@.@@..@.@@@.@@@@@@.@@@@.@...@@@@@.@@@.@.@@@@..@@@..@@.@@@.@@.@@@..@@@.@.@@@@@@@..@@.@@.@@@.@.@@..
@@....@@@..@@@@@.@@.@@@@@.@.@@.@@@@@@@@@.@@@@@@..@@@@.@@.@.@@...@@..@.@@@@@@@@@@@@@@@@..@@@@@@...@@@@@@@@@..@@@@@@@@@..@@@@.@@.@.@.@@@@.
..@.@@@@.@@@@.@..@@@@...@@.@@...@@..@@@@@@.@@....@@..@@@@@@.@@@@@..@..@@@.@@....@@.@@@..@.@..@.@.@@@@.@@@@@.@@...@@@@.@@..@@@@@@.@@@.@..
@.@...@@@@.....@@@@..@@.@@@@@@@.@...@@@.@@@@@@.@.@@@@.@@@...@.@@@@@@@..@@@@@@.@@@@@@@.@.@@...@@@@@.@..@@@@@..@@@.@@@@...@@@@@.@.@.@...@@
.@@@@@..@@@@@@@.@@@.@.@.@.@@@....@@@@@@.@@@@@.@..@.@@@@.@@..@@@@@.@@@@..@.@@@@@@.@@@@@@....@@@@.@@@@@@@@@..@.@..@@@@.@@@@@@...@@@@..@@@@
@@.@@@@@.@@.@@@@@@.@@@.@.@@..@@@@.@@.@@@.....@.@@.@@@@@@.@@@...@@@@@.@@@.@@..@@@@@@@@@@@@@.@@.@....@@@.@.@@@@@@@@.@.@.@@.@@@@.@@@@..@@..
@.@@@..@@.@.@.@@@@@..@@@@.@....@.@@@.@@@.@@.@.@@.@@.@@.@@..@@@.@@@@..@@@.@@.@@@@@@@@@@.@.@..@@@@@@.@@@@@@@.@..@.@@@.@@.@@.@..@.@@@.@.@@@
@@.@.@@@@@@.@....@@@@@@@.@@.@@@@@@@@@@.@@.@.@@@..@@@@@@..@@..@.@.@@@@..@@@.@@..@@@@@@@@@...@@.@@@@@.@@@@@..@..@@.....@@.@@@@..@@@.@@@..@
@@@@.@.@@.@@@@@@@@@..@.@@@@..@.@@..@@@@@@@.@@.@..@@@@@...@@@@@@@@@.@.@.@@@@@.@@...@@.@.....@@@.@@@@@.@.@@.@@.@.@@@..@.@..@@@@.@@@...@@@@
@@@...@.@@@.@@@.@@@@@@....@@.@@.@.@@@@.@@@@@.@@@@.@.@.@@.@@....@.@@@@..@@......@@.@@@@@@@@@@..@@.@@.@@@@.@@@.@@@..@.@.@..@@..@.@@@..@..@
@.@@@@@@.@@@.@@..@.@@@@@.@@@@@...@..@..@@@@@.@..@@@.@..@@@@.@@.@@@@@@.@@.@@@.@@.@.@..@...@@@@@.@@@@@@@@@...@@.@.@...@...@@...@..@@@.@..@
.@@@..@@....@...@@.@..@....@@@@@@.@.@...@@.@@@.@@@.@.@.@@@...@.@@@.@@@.@@.@@@..@@@..@....@.@@@@.@@@@.@.@.@@..@..@..@@...@.@.....@@@@@@@@
.@@..@@@.@@...@@@@.@@@@@@.@@@@@@@.@@.@@.@@@@@@....@@.@.@.@@@@.@.@.@...@@@@@@.@.@@.@@@.@..@@@@.@@@@@.@..@@.@.@..@.@.@@..@@@@.@.@@@@.@.@.@
@@@.@@@@@@..@..@@.@.@@@..@@@@@@.@@@.@.@@@@@@@@@@@@@@.@.@@@.@@.@@@@@.@.@.@....@.@@@@..@..@@.@@@@@@@@@@@.@@@@...@..@.@@@...@@@.@@@..@..@@@
@@.@@@@@@..@@.@@@@@..@@@@@@@@.@@@@@@@@..@.@@@@.@@@@.@@@@@.@@@@@@@.@@..@@@@@@@@@@@.@@@@...@.@..@.@..@.@..@@@@...@@@@@@.@@@.@@@@@.@.@@@@.@
@.@@@...@@.@@.@@@.@@@.@@...@.@@@@@@..@@.@@@.@@@.@.@@@@@..@@@@@@.@.@.@.@@@@@..@@..@@.@@.@..@.@@.@@@..@...@@@..@@...@@..@@@..@@@@@@@@@@.@@
@..@..@@.....@@..@.@.@@@@@.@@.@@.@@@@@@@@..@..@@.@..@@....@@.@@@..@@@@.@@...@@@@@.@@@.@@..@.@@@.@@@@.@@..@@@@@..@.@...@.@@@@.@.....@@@@@
@.@@@.@@@@@@.@@..@.@@@@@@@..@@.@@.@...@.@@....@@....@.@@@@@@@@.@@@@.@@@@@@@..@@@@.@@@@@.@@.@.@@@.@@@@@.@.@@@@.@...@@.@.@..@..@@@@@@.@..@
.@..@..@.@.@@@@@@.@@@.@@@@@@..@.@.@@@.@@@@@@@@.@@@@.@@@.@@@.@.@@.@..@.@@.@@@@@@@.@...@@@@.@@@@@@@.@.@.@@@.@@@...@@@.@@@@@@@@.@...@.@@@@@
.@@@@.@@@.@.@@@@.@...@@@@@..@@.@.@@@@.@@@@@@@..@.@..@@@@.@@@@@@@.@@..@@@@..@@.@.@.@@@@@@@@@@.@@.@@@@@.@@@@@@.@..@.@...@@@@.@..@@@..@@@.@
@....@..@.@@.@..@...@..@@@.@@@.@..@@....@@@.@@.@@@@@@.@@..@@@.@@...@@@@@.@.@@@..@..@.@@.@@@.@@@.@@@.@@@@@@@@@.@@@@@@@.@@@.@.@.@@@..@@@.@
@@@@@@...@@@@@..@@.@@@@@@@.@@.@@@@.@@@@@@@@@@....@@@@@@@.@@@.@@.....@@@.@@@@..@..@@@@..@@..@@@@.@.@@..@.@@.@..@...@@@@@@.@.@..@@.@@..@.@
@@@@@@@.@@@@@@@@@..@@.@.@.@@@.@@@@@.@@@.@@@.@.@@@.@..@.@@@.@.@...@@@@@.@@@.@@..@..@.@@@@@.@@@@@.@.@@.@@...@.@@@@@....@@@..@.@.@@.@@.@@@@
@@@@....@.@@@@.@@..@@@@@..@@.@@@.@@@...@@@.@@@@@....@@@@.@@..@.@.@.@.@@.@...@@@@@@@.@..@...@@...@@@@@@..@.@@@.@.@@....@@@.@@@@@@.@.@@.@@
....@.@@@..@.@@@..@@@@@..@...@.@@@.@@@@@@@..@@@@.@.@...@@@..@@@@..@@..@.@.@@@.@.@@..@.@..@@.@@.@@.@.@.@.@..@@@@@@.@@@@.@.@@@@@..@@@@@@.@
..@.@@@..@...@@...@..@@.@.@@@@.@@.@@..@.@@@@..@@...@@@.@@.@.@@@@@@@.@@.@@.@@..@.@@@@.@@.@@@@..@@@..@@@@@@@...@@..@@@@..@@.@@@.@@@..@@.@.
@@@@@.@.@@.....@@@.@@@@@@@.@@@@@.....@@.@@@.@@.@..@@@@@@@@.@@@.@@.@@.@@@.@@@@@@@@.@.@@.@@@.@@@.@@.@.@@.@@@@.@@..@@@@@@@..@@@.@@@@@.@@@.@
..@.@@@@@.@.@@.@@@@.@@@@@@.@.@...@....@@@@@..@..@@@@.@.@@@.@.@....@@.@@@@@...@@..@@.@@@@.@@@..@.@@@@@@@.@.@.@@@..@@@.@@..@....@..@@@@...
@.@.@@@@.@@..@@.@.@@.@@@@..@@@.@@@.@@@@@@.@@@@@@@.@@.@@@@.@@.@.@.@@@@@..@@@@.@@.@.@@@@...@@@.@.@@.@@@@@@@.@.@@@.@@@@.@@@......@.@@@@.@@@
@..@@@.@@@..@@@..@@@@@@@.@@@@@@.@.@@@@@@.@.@@.@.@...@....@..@@@@@@@@@.@...@@@....@@@@@@@@.@..@@@.@.@.@@.@.@.@@@.@@@@@..@@@.....@.@@.@...
@.@.@.@..@@@..@@....@@..@.@@.@.@@@@.@@@@@.@@.@@.@@@@@@.@.@.@@.@..@.@.@@@@.@@.@.@.@@@@.@.@@..@@@@@..@@@.@....@@.@.@@@@.@...@@@..@@@@.@@..
@.@.@@@.@..@@@@.@.@@..@.@@@@@.@@....@.@@..@..@..@@@@@@.@@.@@@.@..@@@@@@..@.@@.@.@@.@@.@@.@@.@@.@@@@@@@@@@@.@.@@@@@..@@@@@@@.@....@@@...@
@@.@@@@..@@@@@@..@.@@@@@@@@..@..@@@.@.@@@@@..@@@@@.@..@@@@@@@..@.@@@@@@@@...@.@.@@@@..@@@@@@.@@..@@.@@@@@@@.@@@@@..@.@@.@@.@@.@@..@.@.@@
.@@@...@@@@@@@@..@.@@@@@...@.@@@@@@@@@@@.@@@@@@@.@.@@@@@@.@@@@.@@.@@@.@@@@.@@@@@@@@@@@@.@@@@@@@.@@.@.@.@@.@@@@.@.@.@@@@.@@@@@..@@@...@..
@@..@@@@.@@.@@@@@.@.@@.@.@@.@@@@..@@@.@.@.@@@@@@@@@..@@@@@.@@@@.@.@..@@.@@@..@.@.@@@...@@@.@.@..@@@..@@@.@..@@@.@@@@.@@.@@.@@..@.@@@@@@.
.@.@@..@.@@@.@...@@.@@@@@@@@@@@.@@@@@.@@@@@@@@..@@.@.@@@.@@.@.....@@...@@@@@@@.@@@@.@.@@..@@.@@@.@@@@.@@@.@@.@@.@@..@..@.@@.@@@@@.@@@@@.
@@@@.@@@@.@@..@@....@@@@..@.@@.@.@..@.@@@@@..@@@.@@..@.@.@...@....@.@..@@.@..@@.@@@@@@@@.@.@.@.@@@.@@..@@@.@.@@@...@@@@@.@@@@.@..@@@@@@.
...@.@@@@@@@@@@@@@.@@@@@@.@@@@@@@@@@@.@@@@.@.....@@@..@.@@.@@.@@@.@@@@@.@@.@@@.@@...@.@@..@.@@.@@@@@.@@@@@.@@@@.@@@.@@.@@.@@.@..@.@@.@@@
@@...@@@@..@.@..@..@@.@@@.@@.@.@..@@@.@@.@@.@...@.@.@@@..@@@.@@@@.@@.@..@@@.@@@.@@..@@@@@.@@@.@.....@@@@.@@@..@.@@@@@.@.@@@...@@@@@..@..
..@@.@..@@@@...@..@@@.......@@@.@@.@@@.@@@.@@@@.@.@...@@@.@@@@...@@...@@.@@.@@@@@@@@@@.@@@@@...@...@@@@@.@..@.@@@.@@@@@@.@@...@@@..@.@@.
@@@@@...@@.@@.@@.....@@@@...@...@@@@.@@@@@.@@@@.@@@@.@@.@@@..@@@@@@@@.@@@.@@@@..@.@@@@@.@.@.@@..@@.@@@.@@.@@@@@@.....@.@.@.@@...@.@@@@@.
@@..@@@@@@@.@@.@@...@@@@..@@.@.@.@.@@@.@.@...@@..@@@@@@@.@...@@@.@@@@@.@@.@.@@@@.@.@.@.@@.@@@@@@@@@@@.@.@@..@..@...@@..@.@.@.@@@.@@@@@..
.@.@..@@@@@@@@.@..@@@.@@@@..@.@@..@@@@.@@@@...@@..@..@.@@@@...@.@@@@.@..@@.@..@.@@@@@.@@@@.@.@@@@@.@....@.@@@.@@@.@@@@...@.@@@..@....@@@
.@@@@@..@...@@@@@@@@@@@@@@@.@@..@@@..@@@@....@.@@@.@..@@..@@....@@@@...@@@.@.@@@@.@.@@.@....@..@@..@@@.@..@@..@@.@..@@.@.@..@.@@...@@.@@
@@@@@.@@@@.@..@.@@.@@@@@@.@@@@@@@@@@.@@@@.@@@...@@@.@@@@@..@@.@@@..@@@.@@.@@.@@.@@@..@@@@.@@.@@@@.@@@@.@@.@@@.@..@@..@@@..@@@.@..@@@@@@.
......@@@@@@@@@@.@@@@@@@.@@@@@@..@.@.@@@@@@@@@@@@..@@@@.@@@@@@@@@@@@@.@@@@@@@@@@@@.@@@@@.@@....@@..@.@.@..@@...@@.@@@@@@@@@@@@.@...@@@@.
@@@.@.@.@..@@@@.@....@@@.@@@@.@..@@@..@@@@....@@.@@.@@@@.@@@@.@@.@@@@@@@@@.@.@@.@.@.@..@@@..@@@.@..@..@..@.@@@@.@@@@@@...@.@@@@@.@@@.@@@
.@@.@@@@..@.@..@@@.@@@.@...@@@.@@@@.@.@@@@@@.@@@..@@.....@@@@..@.@.@@@@...@@@@@@@...@@@..@@..@@@@@@@@.@@...@@..@@@.@.@@@.@@@.@@@.@..@@@@
@@...@@@@@.@@..@@@..@@@@@.@..@@@@@@.@.@..@.@@@@.@@@@..@@...@..@@@.@@@.@.....@@@@@@@.@...@.@..@.@@...@..@@..@@@.@.@@@.@@@...@@@@.@@.@@.@@
@@@@@.....@.@@.@@@@.@@@@.@@@@@..@@.....@..@@.@@@@.@@@@..@@@.@.@@.@.@@..@.@@@.@.@.@..@@...@@.@@@@@@@.@@@..@@.@@@@@@@.@.@@@@..@..@@.@@.@..
.@@@@...@.@@.@@@..@@@@@.@.@@@@.@....@.@.@@@@.@@@.@@..@@..@@@@.@@.@@@..@....@@..@@@.@@@@@.@@@.@.@.@@...@.@...@@.@@@.@..@@@@@.@..@@@..@.@@
..@.@@@.@@.@@@.@@@@@.@@@@@@.@@@@.@@.@@@.@@@.@..@@..@.@@@.@.@.@@@...@@.@@.@.@@@.@@@.@.@@@@@@@@.@..@@@@@.@..@.@@@@@@@..@@..@.@@.@@@..@.@@@
.@.@@.@@@@@.@@.@@.@@@.....@@@@@@....@@@@@@@@@@@@@..@..@.@@@@@@@.@.@..@..@@.@@.@.@@.@@.@@.@.@..@...@@@.@@@.@..@@...@@@@@..@@@.@.@@@.@..@@
@@@@@.@.@@@..@@@.@@.@..@@@.@@@.@..@@@@@@@.@@.@@@@@@.@@@.@..@@.@@.@@..@@@@....@..@@.@@@@@@@@..@@.@@@.@@....@@@.@@.@@.@.@@@@@@.@.@.@@@..@@
...@@@@..@@@@.@@..@@.@...@..@@@@@..@.@@@..@.@.@@..@...@.@@@.@.@.@@@@@.@@.@.@@@@@@..@@..@.@@@.@.@.@.@@@.@@@@.@.@@@@...@.@@...@@@@@.@..@.@
@.@@@.@@..@@..@.@..@.@@@@@...@@@..@@..@@@@@@@@@@....@.@@@@.@@.@@@@@@@@@@@...@@@@.@@@.@.@@@@@@@@@@@@@@.@@....@@@@@.@...@@.@..@.@.@@@..@@.
@@@@.@@.@@@@@.@.@@@@.@@@.@@@@.@@@@@..@.@@.@...@@........@@@.@@@@@@@@@.@@.@@@@.@@.@@@@@@@....@@@@@@.@...@.@@.@@.@@.@.@@..@@@.@@@.@@@@@@@@
@....@.@.@@@@....@@@@@.@.@@.@@@.@@@@.@..@.@.@.@.@.@@@....@@@@@@.@@@@@..@@@@@.@@@@@@..@@@@@@.@@..@.@.@@.@@....@@.@@@@@@..@@@.@.@...@@...@
@@.@@..@..@.@@@@@@@@..@@@@@.@.@@...@@@@@@..@@@.@@@@.@@@@@@...@.@@@.@@.@@.@@.@@@..@..@.@@.@..@@@.@@@@.@@@@@@@.@@@@@@@@.@.@@.@@@@.....@@@.
.....@@@@..@.@@@.@@.@@@.@.@..@@..@@.@@.@@@@@@@.@@@@@.@.@@@@...@..@..@.@@@@.@@@.@@@.@@@@@@@@@.@@@@.@@@@.@@@@..@.@.@.@@@@@@@@..@@@@..@@@..
@@@@@..@@@@.@@@@@@@@..@@@.@...@@@@@@@@@..@..@....@@@@.@.@@@.@.@.@.@.@@@@@@.@@@.@.@@.@@@@@@@.@@@@.@@.@@@.@@@..@@@.@....@......@@@@@@.@.@@
....@.@@@@..@@@@@@@@@..@@@@.@@@.@@.@.@@@@@@@@@.@@@@@@....@.@@@@.@.@@..@.@.@@@@.@..@@@.@.@@..@.@@@@.@@@@@@@@@.@@...@@..@@@@.@.@@.@@.@@@@@
.@@.@@@..@@.@@@@..@.@@@@@@.@.@...@@@@...@@@.@.@..@@@@@.@@@@.@@@.@@@.@@@@@@@..@@@@.@@@.@@@@@@@@@@@@@.@.@@@.@@.....@@.@@@.@@.@@@@@@@.@@.@@
@.@..@@@@@@@@@..@@@...@.@...@@@@.@@@@..@@@@@@@@@.@@@@@@@@.@..@@@...@@@@..@@@@@.@....@@@..@@@@.@@@.@@@@.@@@.@@@@@.@.@@@@@@..@@@@..@@....@
...@..@@@.@.@@@@.@.@@@.@..@.@@..@.@@...@@..@@@@.@...@@.@@..@@@@@@.@...@@@....@@.@@@@.@.@.@@@.@.@.@.@.@@@.@@@@@@..@@@@@...@@...@.@@@.@@@.
.@.@...@@@.@@@...@@..@@@.@@@@@@@@@..@....@@@.@@.@@@..@@@@@.@@@.@.@.@@@.@@.@@.@...@@@@...@@@..@@@@@@@.@.@@.@@@@@@@.@@..@.@.@@@@@.....@@@@
@.@.@@..@.@....@.@@@@.@.@@@.@@@@.@@.@.@..@@.@@@@@@@@.@.@.@..@@@@.@@...@..@@@@.@@@...@.@@..@@..@.@..@..@@@..@@@@.@@@@@..@.@@@@@...@@.@@@@
@@@...@@@.@.@..@...@@@@..@@@@@..@@@@@@.@@@....@@.@.@@.@.@@@.@@@@.@..@@.....@@@@@.@@@@@@.@.@@@@.@.@.@@@@@@@@@@@@@@@@@@@@...@@.@@@.@..@..@
@@@@@@..@@@@@@@@..@@@.@.@@@.@@@@@@@....@@....@@..@..@@@@@@.@.@@.@@.@..@@@....@@.@@@.@.@@.@@..@@@@@@.@.@@..@.@@.@.@@..@@@.@@@@@@.@...@@@.
@.@..@@..@@@.@@@@@.@.@.@@@@.@@@.@.@.@@@@@...@@@.@.@@.@.@@.@@...@.@@..@@@@@..@@@.@@@@@.@.@@@@@@@@@.@@.@@@@@@@@@..@@..@.@@@@@@@@@@....@@@@
.@@.@@..@@@.@@@@@....@@@.@@@@@@.......@@..@.@....@@.@@@@@@..@.@@@.@@@@@.@@.@@@@@....@@.@.@..@@@..@.@...@@.@@@.@@@@..@@.@..@.@@@..@@@@@.@
@@@@.@@@.@@.@@@@@@@@@.@.@..@@@.@..@@.@@..@@@.@@.@@@@....@.@@.@.@@.@.@@@@@@@.@@@@@@@@@...@.@.@@@@@@@.@@..@..@@@.@.@@@@@@@@.@.@@.@@@@.@..@
@@@@.@.@@@@@..@@.@@@@@@@@.@@@.@.@.@@@@@.@@@@@@@@@..@@....@..@@@.@.@.@@@@@@.@@@..@@..@@...@@..@@@.@@...@@.@@@.@@@@@@@.@@.@@@@.@@@.@@.@@.@
@......@..@@@@@.@..@.@@@@.@.@@@.@@@@.@.@@@@@@@.@@..@.@@..@.@.@@.@@@.@.@.@@@.@@.@@@@@@....@@@@..@@@@@@...@@@@@@@..@@@@.@@@.@@.@@..@@.@@.@
@@@@@@@@@@@.@...@@@@@@@@@@@@@@@@@@@@@@@@...@@@@@@@@.@.@.@@@@@@@@@@@@@@@.@@@.@..@.@@@.@.@@@@@@@@.@.....@..@@.@@@@@@@@..@@@..@@@@@@@@@@...
.@@.@@.@@.@@@@@.@@@@@@@@@@@@.@@@@@@@.@@@@..@@@...@@@..@@@.@.@@@@@.@.@@@@@@..@@...@@.@.@@@@@@.@@..@..@..@@@.@@..@.@@@@.@@@.@@@@@@....@.@@
@..@....@.@@.@..@@..@@@@.@..@@@.@..@@@..@.@@@..@..@.@.@@@@.@.@.@@@@@@@@@@@@.@@@@@@.@@@.@@@.@.@..@@@.@@@@.@.@@@......@@.@.@@.@@.@..@@...@
@..@@@@@@@..@@@.@@@@@@.@.@@@@@@@..@@@@@@@..@@@@@@.@@.@@.@@.@.@@@@@@.@..@@@@..@.@.@@@..@.@.@.@..@.@.@@..@@.@.@@@@@@.@.@.@@.@.@.@@@@@.@@@@
.@.@...@@@@.@.@@@@@@@..@@.@..@@.@@.@..@@@@.@@@@@@.@...@.@...@@@@@@.@..@@@@..@.@..@.@.@.@@@..@..@..@.@@..@@@@.@@.@@.@@@@@@@..@.@.@@..@.@.
@@...@@@.@@.@@@@@@@@@.@.@@@@.@@..@.@.@.@@.@.@@@@@@@.@.@@@@@@..@@.@.@.@@@.@@@@@@@@@@.@@@@.@@..@@.@@@@@....@@@@@.@@@..@@.@...@@@@@@.@@@.@@
...@...@.@@.@.@@@@@..@@.@@@.@.@@@.@@@@@.@@.@..@.@@.@@@.@@@..@.@@@@@@@@@.@@.@@.@@@.@@@.@@@.@@.@@.@.@@..@.@@@@@@@@.@@@@.@.@..@@.@@@...@.@.
.@....@@@@.@.@@@@@.@@@..@.@..@@@@..@@@..@@@.@@@.@@@..@..@..@@...@@.@@@@@@.@.@@@.@@@@@@@@.@@@@@@@@.@@@@@.@@.@@@..@.@@@@.@.@@.@@@@.@@.@@@.
.......@...@@@@@@@@@@@@..@@@@@@@@@@@@@@.@.@.@..@.@@@@...@.@@@.@@@@...@@.@@@@.@@@@@@@@.@@.@.@.@@@@@..@@.@@@.@@.@@@.@..@..@@@@@@.@@@..@.@.
@@@@.@.@@@@@@...@@..@@@@@@@@@.@@.@@@..@@@@@@..@@@@..@.@..@@.@.@@@@.@..@@.@...@.@@@@@@@@@@@@@.@@.@@@@.@@@...@@.@@@@@.@@.@@@..@@.@@@@@@.@.
@@@.@@@..@@@@@@@@@@@@@.@@@@.@..@@@@@@.@....@@@@@@@.@@@..@@@@..@...@@..@@.@@@@.....@@.@.@@@@@@@@@@..@@@.@@@..@@@@..@@@.@@@@@@@.@@@...@@@@
@@@.@@.@.@@@@@@@@..@.@@..@..@@@..@...@.@@@..@.@@@@@..@@@.@@@@@@@@...@@@@.@@@.@..@@@.@.@@...@@.@@@@@@@.@@@.@@.@.@@@@@@@@.@.@@..@@@@@.@@@.
.@..@.@@@@@..@@@.@..@@@@@.@@@.@@@@@...@.....@@..@@@@.@@@.@.@@@.@.@.@..@@.@@...@@@@.@@@@.@@@.@.@@@@@@.@@@.@..@.@@.@@@@.@.@..@@@@@@@..@.@.
.@@.@@.@..@.@.@@...@@@.@..@..@.@.@@@..@.@@.@@@@@@@.@@@@@@..@@...@.@@@@@@@@@...@@.@@@@.@@@@@@@@@@.@@@.@.@..@@..@.@.@@@@@.@@@@@@@.@@@@.@..
@@@.@.@@@@@.@@..@.@@@@@@.@..@.@@@@..@@@@.@@...@@.@.....@@....@@.@@.@@.@@@@.@..@@.@@@@@.@@..@@@.@@...@@.@@@@@@@@@...@@@..@@@@@@@.@@@@...@
@@@@@@@@@@..@@.@@....@.@..@@...@@@@@@.@@@...@@@@.@@.@.@@.@@@@@.@.@@@@@@..@.@@@.@@@@.@@...@@.@@@.@.@@@..@@.@@@.@@@@@@@.@@@.@.@@@..@@..@@.
@@.@..@@@@..@@.@@@@..@@..@@@@@@@@@.@.@.@.@@@@@.@@@@@@.@.@@@@@.@.@@@@.@@.@....@.@@@@@@@@@@.@@@@......@@@@@.@@@@.@@@@@.@@@@@.@@.@@@@@@@@@@
.@@.@@@@@.@@.@@@@.@.....@@...@..@.@@@@..@@....@..@...@.@@@.@..@..@@@@@@..@@.@...@.@@@.@@...@..@@@@@@@@.@@..@..@@@@@@@@.@@.@@@.@.@@.@@.@@
@@..@..@.@@@.@@.@@@.@@@@..@.@@....@@@@@@.@.@@@@....@@@@.@.@@..@..@..@@@.@@.@...@.@@@@@@.@@@@.@@@@@@@@@@..@..@@.@..@.@@@@@..@@@..@.@@@@.@
@.@@.@@@@.@.@..@@@@@..@.@@.@@@...@@@@.@@.@@@@@...@..@@@@@.@@@@@@@@@@..@@..@@@.@.@@@.@@...@@....@@@.@.@..@.@@.....@@@@@.@@..@@@.@.@.@...@
@..@.@@.@.@@...@@@.@@.@@..@.@@@..@@@.....@@...@@@.@.@@@@@@@@.@@..@@...@@.@@.@@..@@@@.@...@@.@.@@@@...@@@@.@@..@.@@@.@@@@@@..@@@.@@@@.@@@
@.@@@@@@@.@..@@@@@@@@@@@@@@@@.@@@@@..@@..@.@@@@@..@@@@@@@.@.@.@@...@..@@@.@@@@.@@.@.@@...@.@..@.@@.@.@@@...@@@@@@@.@@@@.@@@@.@@@@@.@.@..
@@.@@.@@@@@..@.@.@@@@@@@@@@.@@..@@@.@.@@.@@@.@@@..@@...@.@@@.@.@..@..@@@.@.@@@@@.@@@@@@..@.@@@@@.@.@.@@@.@@.@...@@@.@@@@@@@.@@@.@.@@@@@.
...@@@@@@@.@@..@..@@@@@..@@.@@@@@@@@..@..@@@@.@@@@@.@@@.@@@@...@@.@@.@@@@@@@@..@@@@..@@...@@@@@@.@@...@@@@@@.@@...@@.@@@@@@..@@@..@.@@..
@@...@@@.@@@@.@@@@..@@.@.@@..@.@@@@.@.@@@@@@...@@@.@@..@@.@@@...@@@@.@@.@@@.@@@@@@@..@@@@@@@@.@..@@@@@@@@@@.@..@@.@@@..@.@@.@@@@@@.....@
@@...@@@@@......@@@@.@@@.@@.@.@@..@@@.@.@@@.@@@..@@@...@.@@@@@@@@@.@.@@@.@.@@..@.@@..@.@@@.@@.@@@.@@@@.@@@.@.@@.@@.@.@@.@..@@..@.@@...@.
@@.@@@@@..@@@@.@@@.@@@..@@@..@.@.@@@@@@@@@.@..@@@@@@..@@...@@.....@@@@@@@@.@@@@@.@@@@...@@...@@@@@@@.@.@.@@..@@.@.@@.@@@@.@@@@@@@@.@@@@@
.@@..@@.@@@.@@.@@@@..@.....@@@....@.@@@@@@@.@.@..@@@@@.@.@@.@.@..@..@@@.@.@@...@@@@@....@@.@@@@.@@@@@@@.@..@@.@.@@@@@@.@@@.@@@.@@.@@..@.
@.@.@@@@.....@.@.@@.@.@@@@@@@..@@@@@..@.@@@@@.@.@@@@..@.@@@..@.@@@.@@@@.@@..@@@@.@@.@..@@..@.@@@@@@@@@..@@..@.@@@.@@@@.@@@.@@@@@@@@.@@@@
@.@@@.@.@@..@@...@.@@@.@@@.@@.@.@.@@@@@.@.@@@@@@@@@@@@.@@...@.@.@.@.@...@@@....@.@@@.@@.@@@@@@@..@@.@...@...@.@@@@@@@..@@@.@@@..@@@@@@@@
@@.@.@.@@.@@@.@@@@@.@@.@.@@@@@@@.@@@@@@@.@@.@@@@@.@@@...@@.@@@@.@..@@.@@.@@@@.@@@.@@@.@.@@@@@@@@@..@@@@@@@.@@..@@@.@@.@@@.@@.@@.@@@@@@@@
@...@....@@@@..@.@..@.@..@@@@.@.@@...@.@@@@@.@.@...@@@@@@@@..@.@.@@.@@@.@@.@@@@..@@@.@@@@.@@@@@@@..@@@@.@.@@@@.@.@@@@@@.@@.@.@@.@@@.@@..
.@@@@...@@@@@@....@@@...@.@..@@@@@@@@@@.@.@@@@@..@@@..@...@..@@@.@@.@@@.@@@@..@@@.@@@.@@@@@@.@.@@.@@@.@.@@@@@@.@@@.@@@@@@.@@@@.@@@@.@@@@
@@@@..@@@.@.@..@...@.@@@...@..@....@@@..@@@@@@...@.@@@@@.@@@.@@@...@@@@@@.@.@@@..@@@@@..@@.@.@.@.@.@...@@..@.@...@@@@@.@@@..@@.@@.@@@@..
@@@@.@@@@.@@@.@@@@@@@@@@@@@@@@.@@@@@@@@.@@@.@@..@@@.@@.@@@@@@@@@@@@@.@@@...@......@@@..@@@.@..@@@@@@@.@..@@@@...@@@.@@@@@@@.@@@@@......@
.@@@@.@@@@@@@@.@@.@@@..@@.@@.@@..@..@...@.@@@@@@.@..@@.@.@@@.@@@.@@@@@@@@@@@..@@@..@@@@@@@..@@.@.@.@@@.@.@@.@@..@@@@@@@.@.@.@.@.@@@.@...
.@@.@@@@@@@.@@.@@@@@@..@@@@@.@@@.....@@@@@.@@.@@@@@@@@@@@@@@@@.@@@@@.......@@@@@.@@@@..@@....@@.@@@@@..@@.@@@@.@.@@....@@.@@.@..@@@@@@@.
...@.@@.@.@.@@@@@.@@@..@@@@@.@@@@@@@@@@.@@..@@@@@@@...@..@.@@@@.@@..@@@@@@@@@.@@@@@@@@@@.@.@.@@..@@@@.@..@.@@..@.@@@@@@@@@.@.@@@@@@.@@@@
@@.@@..@@.@.@....@.@...@@@@.@@@@@.@..@....@....@@..@@@@@..@...@..@..@@@...@@.@@..@...@@@...@@..@@@@@.@.@@..@.@@.....@@..@@@@......@@.@@.
@..@@@@@@@@.@.@.....@@.@@@@@@@@@@@.@@..@.@..@.@@@.@@@@@@@@@@@.@.@...@@.@@@@.@...@@@.@..@@@.@..@.@@..@@@.@@@...@@@@@.@@.@@..@.@@.@@@.@.@@
..@@..@.@.@.@..@@.@..@.@.@.@@.@@@@@.@@@@@@@@@@..@@@@@@...@@@@...@.@@.@@@@@.@@@@@.@@.@..@..@@@@@@....@@...@@@@...@@@..@.@..@@@.@@@.@@..@@
.@@@@..@@.@@@@@.@.@@.@@.@@@@@@@.@@@..@..@..@@@.@@@@..@@.@.@@@@@...@@.@@@@@.@@.@@@@@@..@@@@@.@.@.@@@@..@..@...@@@.@..@@@@@@@.@@@.@.@@.@.@
@@@@@@@@.@.@@.@@@.@@..@@@@..@..@@@@@@@.@@...@@@@@..@.@@@@@@.@@@@@@..@@..@@.@@.@@@@...@@.@@@...@@@.@..@@@@.@@@@.@@.@@@@@....@@@@@@.@@@@.@
@@@@@...@.@..@@@..@@@..@@@...@@..@.@@@@.@...@.@@@@.@@@...@..@@.@.@@@@@@@@@@..@@@@.@@@@@.@..@.@@@.@.@.@@.@..@@@@..@@..@@.@@@.@..@@@@@..@.
@@..@.@@@..@@@@..@.@@@@...@...@@@@.@@.@.@@.@@@@@.@@.@.@@@@@.@.@@@@.@@@@.@@.@@.@@@@@@.@.@@@..@.@@@.@@@@@@@@@@@@@@..@@@@@.@@@@@@.@@.@.@.@.
@@@@@.@@@@.@@@..@@.@@.@@@@...@@..@@@.@@@..@@.@..@.@@@.@.@@.@@@@@@.@@@@.@.@@@@@@@@.@@..@@@@@@@@@@..@@@@.@@@@@@@@@@@@@@.@@@.@@@@@...@.@.@@
..@@...@@@..@@@@..@@.@@.@@@@@....@.@.@@@@@@.@@@.@@.@.@@@.@@.@.@.@@@@@@.@@@.@@@@.@.@@@@@.@@...@@.@@...@@.@@..@@@@@@@..@.@.@@@..@@..@@@@.@
@.@@@@@@@@@@@@@@@.@..@@@@@.@@.@@@@.@.@.@..@@@@@@@.@@@.@.@@@@@..@@@@@@@@@@.@@@@@..@@@...@@.@.@.@.@@.@....@@@@@.@...@@.@@.@@@@...@@@.@..@@

1180
Inputs/Day5.txt Normal file

File diff suppressed because it is too large Load Diff

5
Inputs/Day6.txt Normal file
View File

@@ -0,0 +1,5 @@
2477 92 399 956 8 44 3 989 459 11 858 93 6 832 9 92 69 53 44 43 3 75 2 2 88 6 988 7 8 8171 71 1 6 2986 41 137 84 158 62 676 584 9765 49 723 33 1 38 65 96 53 181 541 29 781 5843 3636 278 57 719 619 9 79 82 227 3 68 3 43 76 3594 42 88 29 4 46 75 77 36 55 43 763 2588 775 86 949 48 5 59 2237 94 9 953 924 6 6 753 4 4 96 691 8 1 51 5174 6 196 1 744 52 35 45 84 2 45 515 325 3 2 31 859 17 569 747 3 6 117 83 9 52 7786 25 6278 7 168 61 3 647 75 817 74 5 34 1 15 691 42 75 33 45 54 5 914 78 47 98 876 5 685 52 25 7 6 758 463 4 39 544 25 62 7 145 374 899 78 8 54 1555 922 65 8736 6 1136 59 4749 187 69 97 469 3 698 844 26 3 23 92 32 7772 19 849 5774 77 46 98 65 39 686 1818 9 6489 217 835 78 629 149 2 6 47 571 9748 64 69 3 69 7 268 5 14 8 23 472 9 453 89 731 1 672 4 94 547 58 912 2793 56 35 261 7662 72 532 52 2 25 2 41 4 422 957 333 75 86 2 173 46 99 9436 78 34 433 267 26 324 246 5 144 243 234 91 7542 52 98 81 91 86 57 293 464 6931 5 594 8 96 23 3 166 77 99 453 73 469 98 2 342 74 8764 562 23 638 125 57 661 994 393 42 531 2 59 378 76 1 7 86 961 32 9 469 458 47 22 83 7 36 45 4 519 5128 74 11 15 38 2 497 59 1 54 3617 174 8323 7 73 4896 579 33 1 8 825 24 6622 95 69 35 26 84 463 16 6 92 6 644 387 79 41 4 4723 576 4 74 921 78 7 5134 447 741 61 3 92 469 2187 965 79 7 86 21 18 83 558 5 5792 294 26 86 3 6219 16 13 799 11 592 59 9375 526 97 14 6349 4 286 1 628 2 192 449 52 9 55 3761 221 9 3 124 1 1 59 75 15 922 1 561 3 13 91 66 85 315 68 8 59 58 87 137 7 226 27 19 926 527 9 45 619 73 72 812 12 449 16 172 45 925 7922 414 931 87 257 232 177 16 98 59 74 3 92 62 946 8 52 894 78 35 878 29 48 2642 82 98 91 59 79 76 2174 1628 1 61 63 981 6 33 193 494 6 78 92 46 54 83 9 36 7 923 59 644 7 68 6976 42 82 68 83 81 19 18 35 669 13 18 83 282 364 8 2 463 1471 21 687 3 4833 4797 37 379 3 67 65 52 75 777 1 5 43 24 583 54 15 68 75 351 6576 36 1 9951 42 25 267 94 81 13 214 6 828 538 78 5 92 229 92 32 9476 51 825 367 9 978 32 5 171 3867 48 179 634 617 5 96 978 4999 44 75 14 396 3 92 17 8865 23 644 75 79 91 161 343 35 273 96 46 48 83 19 346 141 269 75 516 19 894 155 95 8 421 86 62 91 86 4861 35 899 17 6 75 2 81 43 168 81 33 6664 36 78 63 491 9594 9987 722 435 879 48 267 56 68 92 33 15 86 17 946 74 876 667 8 729 829 72 93 256 56 552 99 238 927 384 142 9942 558 362 6 713 1 9 14 75 38 962 662 12 49 9736 68 8 71 923 85 31 546 62 49 82 31 37 33 61 566 42 733 4934 271 79 4 99 699 8 44 63 414 41 44 39 916 79 16 8 224 2 83 74 286 7 674 23 39 83 34 3 574 8285 112 8624 487 38 3 5 1 247 12 21 414 666 66 4 642 79 941 17 942 82 65 6165 9518 29 668 82 13 26 6492 445 5 63 25 494 357 8 17 6 47 32 1919 28 146 416 7 983 25 3538 67 11 85 3 21 129 37 67 58 733 1991 11 25 7 43 358 73 3244 872 67 145 5 1 32 2 49 4 769 1887 15 585 912 76 59 95 5 68 18 7 63 689 594 45 526 6 569 1 1 4 34 62 71 6478 4 81 2 68 7934 42 77 48 3219 596 414 992 983 331 8 68 29 249 6 86 247 257 81 97 7 587 4 58 512 129 55 5582 41 21 27 2 41 26 832 76 13 9763 928 91 495 78 5 176 396 97 64 35 99 89 21 4 7492 9 1 847 4 34 1529 2 28 6 44 983 36 88 3 3 5 921 144 3 273 52 34 435 4 9 48 54 5438 73 8121 345 2 27 36 57 538 46 19 75 9 7989 882 96 388 67 82 79 7 6 693 481 12 61 317 9 32 59 17 27 6 3292 9 7 5 15 8312 1 9 774 7 3 8 29 61 35 64 73 8977 733 37 88 6981 48 8 8 55 29 2 7 78 13 4373 74 54 4
3524 4 525 936 5 11 8 756 85 278 593 15 318 363 28 36 66 53 28 24 31 19 75 51 15 54 438 83 2 7698 68 8 5827 7972 11 942 67 5874 45 349 832 9364 3 744 64 19 22 53 5 33 4683 639 27 489 8517 8716 219 45 833 315 39 17 62 419 1 49 31 14 94 6865 62 69 63 4 48 77 81 33 13 789 545 4349 657 94 689 69 42 156 6321 863 96 263 3256 48 21 497 48 42 56 831 52 7 8936 6662 74 623 5 239 22 42 21 17 514 41 877 231 79 56 74 975 53 681 5769 6 93 962 917 9 76 7181 75 7626 27 498 272 48 571 93 883 786 8 72 5 52 692 12 25 59 37 57 71 785 97 81 54 152 54 358 47 97 39 939 619 449 48 18 262 865 18 57 578 695 178 68 47 35 729 397 62 4373 9 4865 599 6275 756 76 91 798 8 272 647 76 48 47 64 29 5815 855 12 8982 66 28 13 6 1 525 9547 49 5782 243 291 557 148 24 1 1 32 242 8593 39 165 63 236 294 973 51 62 64 76 268 55 573 26 936 11 344 29 42 114 56 318 1236 816 59 193 7522 68 617 22 62 51 27 78 98 345 137 333 57 19 53 833 59 11 7893 424 55 792 168 86 759 538 91 681 791 639 88 722 32 34 99 71 99 97 518 775 4816 3 726 6 17 37 728 453 67 353 846 55 936 6 439 546 42 3252 664 19 453 57 91 329 629 646 2 1523 494 82 386 363 89 9 561 67 248 41 248 742 18 83 66 82 31 24 16 824 345 58 255 62 16 11 671 83 3 75 8843 538 2398 1 92 8284 68 99 235 1 117 65 4614 254 52 25 65 16 649 86 52 62 96 183 815 81 88 28 1154 641 51 13 454 74 6 1655 329 4994 13 11 6918 871 1446 499 18 92 42 23 89 38 172 8 6774 875 33 19 25 8339 72 73 774 38 8426 41 1162 87 38 53 3822 25 927 58 567 55 225 298 81 25 33 6243 575 52 9 714 7 74 74 22 53 142 7 275 5 72 94 21 52 498 89 5 99 23 24 177 5 889 28 11 687 777 31 35 983 39 45 578 81 924 29 557 85 149 6725 868 158 54 277 78 259 84 79 22 832 43 45 93 818 3 46 688 81 72 962 57 49 585 45 33 78 35 92 55 7254 9999 7 5758 15 599 9 84 921 784 61 23 39 188 72 86 7 87 394 3729 726 472 3 59 6657 96 234 84 21 425 46 37 61 561 857 82 5961 7837 619 5 24 996 9647 47 224 9 2828 4863 83 189 11 5 67 83 99 765 58 21 171 69 498 18 786 711 174 221 9588 27 57 6556 756 75 387 72 35 133 758 86 641 723 245 1 95 116 61 69 535 71 646 878 48 111 44 76 213 9698 125 543 316 882 8 53 212 5191 14 32 79 78 925 11 75 9226 13 639 65 65 913 448 114 2224 754 262 63 23 27 25 32 135 574 29 1295 28 844 441 54 473 789 57 65 88 76 8335 9124 5163 718 5 42 62 29 41 481 11 623 3458 66 47 38 194 2492 4658 558 362 3914 61 372 82 17 62 6 752 768 821 2731 1 993 164 54 687 221 89 55 292 1 291 252 371 564 814 582 131 938 786 833 781 6 2 21 611 55 927 556 43 559 6367 29 629 22 295 78 51 8697 8 38 54 42 57 852 947 93 57 376 3884 812 531 479 99 687 75 23 53 558 93 314 74 396 62 85 996 93 37 57 59 187 5 868 91 97 226 48 87 113 2366 962 3969 565 921 91 55 3 423 78 48 41 84 81 997 948 83 957 82 5721 78 19 9556 8782 52 728 48 85 31 9827 964 679 72 8 46 336 7 18 8 612 13 44 135 753 624 88 145 66 9781 31 97 15 6 94 85 52 61 86 881 1697 43 28 8 35 664 27 7275 339 18 713 181 735 39 894 26 43 794 8772 49 861 69 54 574 38 547 547 45 64 26 822 783 89 492 4 2297 7 38 36 97 33 91 3312 73 57 98 38 4598 33 21 65 8971 2793 538 169 827 966 5 871 91 514 4 13 9839 918 62 32 97 648 12 31 8 678 9 2872 35 259 26 976 565 97 644 72 91 6271 571 9317 734 39 74 778 498 24 75 57 95 11 43 4 7566 4 639 936 76 38 5512 3999 94 4 294 792 51 64 899 64 7 836 857 46 842 559 898 352 46 85 87 31 6861 76 4421 947 91 62 92 776 633 42 82 884 76 9929 79 84 398 9 71 81 89 59 838 944 393 54 326 6 21 79 571 284 68 4797 3 97 5 85 3634 1 675 482 25 4 57 57 44 38 59 11 8745 263 85 672 8866 46 572 192 81 54 9 25 8996 78 3141 76 91 37
6243 4 595 999 5 61 389 48 35 289 956 63 563 77 84 57 7 22 75 941 56 46 61 64 91 442 318 57 45 1474 71 697 2699 1527 62 151 69 7235 94 161 698 6125 9 513 33 86 28 18 1 58 2346 622 54 826 767 6511 732 4 357 1987 78 112 1 799 6 9 12 13 79 9383 816 21 14 33 385 35 44 5 51 791 118 377 886 7 55 93 343 912 49 694 89 648 3334 71 338 546 66 721 98 986 56 88 7824 6928 22 892 33 549 8 62 9 11 326 66 595 27 39 43 15 89 61 254 2272 83 58 5467 1419 12 66 581 23 394 94 473 636 211 239 82 993 752 56 41 737 23 51 16 15 36 93 253 599 64 93 38 36 958 93 439 83 93 27 6434 569 42 85 49 51 237 32 95 894 753 265 76 74 918 245 516 29 19 9 1897 277 724 247 78 93 121 89 87 872 66 75 48 56 82 9358 567 65 3414 771 969 66 7 2 968 223 18 8492 257 789 986 7753 49 529 4 852 282 696 24 972 63 5189 351 12 596 5 877 52 751 757 385 96 66 544 685 35 66 831 31 422 9237 913 27 441 3594 95 765 99 35 67 611 22 97 79 821 251 934 617 917 248 91 29 3667 293 4 776 874 21 234 47 39 136 538 8 74 294 59 27 71 68 98 52 2 172 625 95 1352 44 47 67 311 986 22 748 855 58 163 1 6116 986 94 1449 223 35 452 82 41 85 725 74 4 8719 2177 66 655 329 62 8 924 66 413 324 182 956 6 44 54 244 71 491 64 376 217 96 977 85 71 45 185 64 79 1 751 922 2697 76 93 9675 22 56 711 85 724 93 151 771 9 55 11 897 832 63 982 27 46 976 622 82 842 972 2292 546 44 53 347 25 53 6122 199 3665 77 48 9248 155 1416 396 41 65 97 2 52 79 478 81 734 958 284 14 436 8783 38 58 723 82 8164 12 6122 92 82 87 1963 91 415 75 35 52 635 894 55 76 315 5868 988 99 72 991 83 612 99 76 39 429 269 91 86 56 68 56 69 923 4 94 44 39 3 963 25 33 91 43 53 389 65 4 421 8 9 194 36 687 24 516 87 347 657 23 99 86 397 44 691 55 66 24 781 14 37 91 576 197 32 856 43 34 694 53 79 169 48 76 88 3 67 24 672 8537 132 4486 27 925 575 33 948 793 164 96 51 266 18 68 829 6 114 4438 176 5 16 32 81 93 751 58 67 7663 61 5 153 38 938 73 3387 4737 814 68 19 654 76 84 461 9 1438 652 25 364 69 3 75 2 35 784 32 891 271 48 611 55 874 596 721 388 7995 94 386 8146 741 5 499 51 26 498 255 78 1587 262 152 77 28 347 99 18 754 71 83 753 67 24 46 263 59 9758 326 799 213 611 492 691 993 669 28 81 1 34 9976 71 3 1472 28 787 63 998 897 867 86 3867 437 9776 75 53 57 83 47 841 81 41 8854 72 734 628 15 949 275 2 97 91 45 31 1713 3573 722 29 913 34 68 9 159 79 557 589 4 63 67 137 325 2452 7 99 7318 66 39 68 69 67 6 315 772 117 1594 2 197 984 182 695 741 538 86 526 8 637 419 486 772 354 199 11 471 8 8789 92 16 368 35 479 92 355 236 25 588 5914 583 144 6 452 6 8 5849 2 73 64 53 29 741 2754 66 1 497 818 559 913 885 53 191 43 272 89 975 11 2156 97 682 74 32 759 1 37 96 82 995 6 696 866 41 681 55 3227 34 8466 743 221 27 164 51 16 6 91 512 38 5 61 71 789 4858 837 772 58 1999 75 8 8891 6 667 99 5 89 29 9769 717 254 45 3 88 749 84 22 36 327 46 2 887 5914 473 41 33 42 348 682 41 24 16 17 51 47 47 19 2797 798 54 2 94 19 97 78 6427 383 1251 38 887 263 42 111 15 87 929 2439 9 171 82 66 138 27 687 431 18 13 574 749 816 66 285 16 9695 56 79 53 6 93 4624 824 79 26 76 68 147 86 69 42 844 9751 1961 64 3743 28 7 151 4 563 23 9 6196 624 212 81 94 84 86 92 9 174 4 7889 75 121 8 521 666 2 68 49 9 261 211 5289 86 74 96 462 757 26 4 597 9 33 119 62 784 4 4252 933 92 54 8423 9562 32 74 425 42 18 13 535 559 43 149 858 83 525 951 944 775 641 87 664 23 4543 64 9193 459 69 49 381 158 24 53 52 172 512 1841 66 89 26 3 4 853 18 63 914 537 589 6 85 5 41 47 434 351 531 461 48 76 1 3 2789 11 276 637 92 17 43 53 494 83 42 3 477 44 98 2948 277 66 9569 816 26 57 34 794 9725 51 858 15 828 17
44 4 677 9 75 13 526 28 68 189 537 572 232 3 23 31 8 71 23 719 15 161 21 94 18 648 939 791 53 9839 46 954 4137 835 28 67 6 4633 24 348 217 136 2 378 28 57 55 96 3 17 9319 879 4 266 541 1633 6 9 142 9496 18 524 2 17 54 8 51 4 55 753 463 85 89 43 758 94 9 2 77 232 374 498 946 9 7 5 234 561 23 212 1225 413 5363 93 1275 112 21 515 91 86 73 388 5887 57 54 32 69 298 2 84 3 78 272 28 44 79 46 11 62 34 57 892 5485 27 52 4894 5922 694 59 376 23 5 18 28 262 153 813 28 38 212 96 1 348 32 2 63 26 79 23 621 192 57 89 87 88 2781 51 84 8 49 17 5145 57 75 82 3 22 689 97 71 488 39 2 9 49 486 732 7331 937 65 13 558 126 6 68 91 92 942 346 2 145 94 653 91 96 11 9495 763 3 758 756 363 2 3 1 119 65 43 165 48 13 5993 4351 2 895 68 412 1 581 496 517 29 4451 236 39 736 8 623 2 253 928 8 92 5 379 511 69 25 674 59 733 257 452 2 63 668 1 418 85 37 12 772 62 82 9 93 5 5682 457 813 827 31 56 4 478 7 91 2 59 862 9 18 737 56 6 28 2 93 69 62 26 48 31 6 138 77 99 5487 13 27 28 467 65 96 867 82 42 929 4 4216 98 43 1685 49 45 13 9 85 49 79 51 2 7321 6454 13 148 396 54 28 648 27 452 445 1397 518 6 57 9 296 5 367 32 77 22 89 273 41 31 88 416 91 46 2 13 2 856 18 472 122 96 1544 788 75 837 53 1 598 5 84 78 728 29 81 593 8 99 949 762 91 868 273 18 51 234 23 51 83 51 386 1 6372 47 32 7821 63 39 868 95 77 7 1 9 924 653 91 439 163 442 2 441 4828 59 6 113 99 6543 46 674 71 9 59 2 75 356 259 2 11 3737 938 61 828 983 988 16 84 37 742 51 243 266 3 99 386 626 47 47 41 49 6 71 75 3 982 77 77 6 213 47 13 4 16 13 442 21 6 875 7 1 2 58 233 59 586 35 79 1 52 6 57 34 64 37 17 12 81 622 14 76 17 31 254 9 379 68 58 55 24 3 88 15 2 54 8 5 26 623 7 396 6156 92 664 473 56 83 165 218 1 4 776 25 87 278 6 844 4416 924 1 48 2 3 28 866 28 5 4248 88 1 756 99 636 26 2438 1483 11 54 979 72 59 17 121 13 94 48 52 256 37 2 14 6 3 118 69 2839 721 61 682 75 982 514 531 69 4178 8 255 9521 234 9 36 882 36 173 982 76 3564 737 762 11 69 66 332 52 175 63 9 556 64 87 44 5488 9 424 895 864 7 262 986 4665 8 964 21 15 5 75 5275 85 5 691 75 47 87 282 869 14 2 5566 768 4994 957 1 24 82 5 78 8 3 5628 89 216 1 36 987 99 9 65 59 89 5 7342 1876 832 63 997 19 72 5 82 12 685 4 2 17 1 27 63 7676 2 23 9748 75 74 46 42 97 7 2581 438 731 5298 2 5 448 582 315 677 425 88 912 4 829 485 1 54 37 47 1 854 2 6817 83 38 733 66 654 5 33 213 18 5471 749 398 956 3 413 5 2 6372 3 76 61 461 18 678 3947 9 6 17 784 73 742 584 48 98 62 371 7 8 73 3475 83 857 3 8 266 7 98 96 64 27 69 876 772 4 535 3 6662 3 824 487 586 97 961 17 36 63 12 761 94 1 6 8 8459 5463 877 561 17 1295 67 2 25 4 959 1 6 39 5 837 61 439 22 7 9 4 84 2 96 617 362 4 447 2422 715 26 1 43 792 482 6 5 96 52 49 82 9 15 9332 42 57 1 82 7 6 39 828 47 2865 33 514 371 14 871 63 41 1 87 7 442 66 54 863 471 225 668 23 17 777 16 27 35 6 771 4416 48 94 19 6 19 7595 9 38 47 62 45 61 4 42 572 66 9496 3978 6 8437 87 89 874 6 354 58 6 6218 543 719 64 95 3 22 18 7 77 9 48 6 934 7 918 139 5 7 84 2 1 39 2633 86 9 39 378 624 53 4 378 5 99 1252 62 654 65 7241 81 63 6 744 3881 9 81 342 23 33 79 978 779 62 69 769 56 988 673 938 964 333 72 655 64 52 13 9738 16 711 5 641 476 68 3 92 594 832 99 58 56 31 7 1 232 29 15 151 26 199 8 8 49 65 9 498 712 485 555 82 88 58 6 5747 35 257 668 84 27 91 4 832 69 36 2 462 4 81 1656 19 3 1118 694 93 52 288 456 3738 63 78 974 968 34
+ * * * * * + + + * + * + + * + * + + * * + * * * * * + + + * * + + + + * + + * * + * * * + * * + * + * + * + + * * + + * * * * * + + + * + * * * * + * + + * + + + + * + + * + + * + * + * + + * * + + * * + + + + + * * * * + * * * * * + + * * * + * * + + * * + * + * + * * * * * + + + * * + + * * * + * + * + + + * + * * * + + + * * * + * + * * * * * + + + + + * + * + * * * + * + * * * * + * + * + + * * + * * + + * + * * + + * + * + + + + + + + * + * * + * * + + * * * * + + * * * + + * * + * * + * + * * + * + * + + + * + * + * + + * + + + * + * * * + * + + * + * * + + + + + * * * + * + * + + * + * * + * + + * + + + * + + + * + + * * + * + + + * * + * * * * + + + + * + * + * * * * + + + + + + + + + + * + + * + + * + * * * * + + + * + + + + * * * * + + + + * * + * + * * * + * + + * * + + * + * + * + + * + + + + * * + + * + + + + * + + * + * + * * * * + + * + + * + * * + + + + + + + * + + * * * + * + * + + * * + + * + + * + + * * + + * + * + * + + + * * + + + + + + + + * * + * * + + + + + * + * + * + + * * * * + * + * + * * + * + * * + + + * + + * + * + + * * * * + * * * + + * * * + + + + * * + + * * * + + + * + + * + + * * + + * + * + * + * + * + * + + * * + * + + * + * * * * * + + + * + * + + * * + * + + + * * * + + + * * * + * + * + + + + * * * * + + + + + + + + + * * + + + + + + * + * * + + * * + + + + + + + + + * + + + + * + * + * + + * * * + + * + + * + * + * * * * * + + + + * * * * * * + * * * * + + + * * * + + * * + + * * * + + + + + * * * * * * + + * + + * * * + + + + + * * * * + * * * * * + + + * * * + * + + + + + * + + + * * + + * * + + + + * + * + + * * * + + + * + * + + + * + + * * * * * + + * + * * + + * + * + + * + + * * + * * + * + + * * * * + + + + * * + + * * * * + * * * + + + * + + * * * * * * + + + + + + + + + * * + * + + + + + * * * + * + * * * * * + + + * * + * + * + + + + + + * + * * * + * * * * + * + + + * * + * * + + + * * + * * + + * * * + + * * * * + * * + + + * * + + * + + * + + * + * + * + * * * * * + * * + + + * + + * + * * + + + + + + * * *

142
Inputs/Day7.txt Normal file
View File

@@ -0,0 +1,142 @@
......................................................................S......................................................................
.............................................................................................................................................
......................................................................^......................................................................
.............................................................................................................................................
.....................................................................^.^.....................................................................
.............................................................................................................................................
....................................................................^...^....................................................................
.............................................................................................................................................
...................................................................^.^...^...................................................................
.............................................................................................................................................
..................................................................^.^...^.^..................................................................
.............................................................................................................................................
.................................................................^...^...^.^.................................................................
.............................................................................................................................................
................................................................^.^.^.^...^.^................................................................
.............................................................................................................................................
...............................................................^...^.^.^.^.^.^...............................................................
.............................................................................................................................................
..............................................................^.^.^...^.^...^.^..............................................................
.............................................................................................................................................
.............................................................^.^.^.^.^.^.^.^.^.^.............................................................
.............................................................................................................................................
............................................................^...^...........^...^............................................................
.............................................................................................................................................
...........................................................^.^...^.^.^.^.^.^...^.^...........................................................
.............................................................................................................................................
..........................................................^.^.^.^.^...^.^.^.^...^.^..........................................................
.............................................................................................................................................
.........................................................^...^...^.^.^.^.^...^.^.^.^.........................................................
.............................................................................................................................................
........................................................^.^.^...^.^.^.......^.^...^.^........................................................
.............................................................................................................................................
.......................................................^.^.^.^.^.^.......^.^.^.......^.......................................................
.............................................................................................................................................
......................................................^.^.^.^.^.^...^.^.^.^.^...^.....^......................................................
.............................................................................................................................................
.....................................................^.....^.^.^.....^.^.^.^.^.......^.^.....................................................
.............................................................................................................................................
....................................................^.^.....^.^.^.^.^.^.^.^.....^.^...^.^....................................................
.............................................................................................................................................
...................................................^.^.....^.^.^...^...^.^.^.^.^...^.^.^.^...................................................
.............................................................................................................................................
..................................................^.^.^.....^.^...^.^.^.........^.^.^.^.^.^..................................................
.............................................................................................................................................
.................................................^...^...^.....^...^.^.^.^.^.....^.^.^.^.^.^.................................................
.............................................................................................................................................
................................................^.^.^.^.^...^.^.^.^.^.^.^.^...^.....^.^.^.^.^................................................
.............................................................................................................................................
...............................................^...^...^.^.......^...^.^.^.^.^.^.....^.^.....^...............................................
.............................................................................................................................................
..............................................^.^.....^.^.^.....^.^.^.....^.....^.^.......^.^.^..............................................
.............................................................................................................................................
.............................................^.^.^.^...^.......^...^.^.^...^.^.......^.^.^...^.^.............................................
.............................................................................................................................................
............................................^.....^...^.^.^...^.^...^.^...^.^...^.^.^.^.^.^.^.^.^............................................
.............................................................................................................................................
...........................................^.^...^.^.^...^.^...^.^.^.^...^...^.^.^.^.^...^.^.....^...........................................
.............................................................................................................................................
..........................................^...^.^.....^.^.......^...^...^...^.......^...^.^.......^..........................................
.............................................................................................................................................
.........................................^.......^...^.^.^.....^.^.^.^...^.^...^.^...^.^.^.^.^.^...^.........................................
.............................................................................................................................................
........................................^.^.^.^...^.^.^.^.^.....^...^...^.^.....^...^.^.^.^...^.^...^........................................
.............................................................................................................................................
.......................................^.^.^.^.^.^.......^.^.^...^.......^.^.^...^.^.^.^...^.^.....^.^.......................................
.............................................................................................................................................
......................................^...^.....^.^...^.........^.^.^...^.^.^.^.^...^...^.....^.^.^.^.^......................................
.............................................................................................................................................
.....................................^...^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.....^.^.^.^...^...^.^.^.....^.....................................
.............................................................................................................................................
....................................^.^.^.^.^.^.......^.^.^.^.....^.^.^.^.^.^.....^.^.....^.^.^.^...^.^.^....................................
.............................................................................................................................................
...................................^...^.^.^.^...^...^.^.........^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.....^...................................
.............................................................................................................................................
..................................^.^...^.^.^.^.^...^...^.^.^.........^.^.^.^.^.^...^.^.^.^.^.^.....^.^.^.^..................................
.............................................................................................................................................
.................................^.^.....^...^.^.^.^...^...^.^.^.^.^.^...^.^.^.^.....^.^...^.^.^...^.^.^...^.................................
.............................................................................................................................................
................................^.^.^.^.^.^.....^.^...^...^.^.^.^.^.^...^.^...^.^...^.^.^.^...^.^.^.^.^.^...^................................
.............................................................................................................................................
...............................^...^...^...^.^.^.^.^...^.^.^...^.^...^.^.^.^.....^...^.^...^.......^.......^.^...............................
.............................................................................................................................................
..............................^.^.^.....^...^.^.^.^.^.^.^.^.^.^.^...^.......^...^.^.^.^.^...^.......^.^.^.^.^.^..............................
.............................................................................................................................................
.............................^.^.^.....^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.^.^.^...^...^.^...^...^.^.....^...^...^.............................
.............................................................................................................................................
............................^.^...^.^.^.^.^.^.^.^...^.^...^.....^.^.^.^.^...^.^.^.^...^...^.^.^.^.^.^.^...^...^.^............................
.............................................................................................................................................
...........................^.^...^.^.....^...^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^...^...^.....^.^.^...^...^.^.^.^.^.^...........................
.............................................................................................................................................
..........................^.^.^.^.^.^.^...^.^.^.^...^.^.......^.^...^.^...^...^.....^.^.^...^.....^...^.^.^.^.^.^.^..........................
.............................................................................................................................................
.........................^.^.^.^.^.^.^.....^...^.^.^.^.^.^...^.^.^.^.^.^...^.........^.....^.^.^.^.^...^...^.....^.^.........................
.............................................................................................................................................
........................^...^.^...^.^.^.^.^.^.^...^.^.^.^.^.....^.^.^.^.^.^.^.....^...^.^.^.^.^.^...^.^.^.^...^...^.^........................
.............................................................................................................................................
.......................^.^.^.^.^...^...^.^...^.^.^.^.^.^...^...^.^...^.^.^.^.........^.^.^.^.....^.^.^.^.^...^.^...^.^.......................
.............................................................................................................................................
......................^.^.^.^.^.^.^.^.....^.....^.^.^.^.^.^.^.^.^.^.....^.^.^...^...^.^.^.^.....^.^.^.....^.^.^...^.^.^......................
.............................................................................................................................................
.....................^.^...^...^.^.^.^.^.^.^...^.^...^...^.^...^.^...^.....^.^.^.....^.^.^...^.^.^.^.^.^.^.^.^...^...^.^.....................
.............................................................................................................................................
....................^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.^.^.^...^.^.^.^.^...^.^.^...^.^.^...^...^.^.^.......^.^.^...^....................
.............................................................................................................................................
...................^...^...^.^.^.^.^...^.^.^.^.....^.^.^...^.....^.^.^.^...^.^...^.^...^...^.^.^.^...^.^.^.^.^.^.^...^.^.^...................
.............................................................................................................................................
..................^...^.^...^.^.^...^.^...^.^.^...^.^.^...........^...^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.....^.^.^.^.^.^.^.^..................
.............................................................................................................................................
.................^.^.....^.^.^...^.^...^.^.^...^...^.^...^.^.^...^.....^.^.^.^.^.^.^...^...^...^...^.^...^.^.^.^.^.^...^...^.................
.............................................................................................................................................
................^.^.^...^.^.^.^.^.^.^.^...^.^...^.^...^.^.^.^.^.^.^.^.^.^.^...^...^.^.^.^.^.^.^.^.^...^.^.^.^...^.^.^.^.^.^.^................
.............................................................................................................................................
...............^.^.^.^.......^.^.^.^...^.^.^.^.^...^...^.......^.^.^.^.^.^.^.^.^...^.^.^.....^.^.^...^.....^.^.^...^...^.^...^...............
.............................................................................................................................................
..............^...^.^...^.^...^.^.^...^.^.^...^...^.^...^...^.........^.^.^.^.^...^...^.^...^.^...^.^.^...^...^.^.....^.^...^.^..............
.............................................................................................................................................
.............^.......^.....^...^.^.^.^.^.....^...^...^.^.^.^.^.^...^.......^.^.^.....^.^.^.^.^.^.^.^.....^.^...^...^.^.^...^.^.^.............
.............................................................................................................................................
............^.^...^...^.......^.....^...^.^.^...^.^.^.^.^.^.^.....^...^.^.....^.^.^.^.^.^.^...^...^.^.....^.^.^.^.^.^.^.^.^.^.^.^............
.............................................................................................................................................
...........^.^...^.....^...^...^.^.^.^.^.^.^...^...^.....^.^.^.^.^...^...^.^.^.^.^...^.^.^...^.^.....^...^.......^...^...^.^...^.^...........
.............................................................................................................................................
..........^...^...^.^...^.^.^...........^...^...^.^.^.^.^.^...^.^.^...^...^.^...^.^.^.^.^.^...^.^.^.^.^.^.^...^.^.....^.^.^.^.^.^.^..........
.............................................................................................................................................
.........^.^.^.....^.....^.^.^.^.^.^...^...^...^.^...^...^.^.^.^.^...^.^.^.^...^...^.^.^.^.^.^...^.....^.....^.^.^.^.^.^.^.^...^...^.........
.............................................................................................................................................
........^.^.^...^.^...^.^.^.^.^.^.^.^.^.^...^.^...^.....^.^.......^.^.......^...^...^.^.^.^.^.^.^...^...^.^.^.^...^.^.^.^.^.^.^.^...^........
.............................................................................................................................................
.......^...^.^.^.^.^.^...^...^.^...^.....^...^...^...^.^.........^.^.^.^.^.^.^.^.^.^...^...^.^.^...^.^...^.^.^.^...^.^...^.^.^...^.^.^.......
.............................................................................................................................................
......^.^.......^.^.^...^.^.^.^...^.^.^.^.^.^...^.^.....^.^.^.......^.^.^.^.^.....^.^...^.^.^.^.^.....^.^.^.^.^.^.^.....^...^...^.^.^.^......
.............................................................................................................................................
.....^...^.^.^.....^.^...^...^.....^.^...^.^...^.^.^...^.....^.^.^...^.^.^.^.^.^...^.^.^.......^.^.....^.^.^.........^...^.^.^.^.^.^.^.^.....
.............................................................................................................................................
....^.^...^.....^.^.....^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.....^...^.^...^.^...^...^...^.^.^.^.^.^.^.^.^.^...^.^.^...^.^...^.^.^...^.^...^....
.............................................................................................................................................
...^.^.^.^.^...^...^.^.^.^.....^...^.^.^.^.....^...^.....^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^...^.^.^.^.^.^.^...^.^.......^.....^...^.^...
.............................................................................................................................................
..^...^.^...^.^...^.^.^.^.^...^...^.^.^.....^.^.^.^...^.^.^...^.^...^.^.^.^.^.^.....^.^.^.^.^.^.^.^.^...^...^...^...^.^.......^.^.^.^.^.^.^..
.............................................................................................................................................
.^.^...^.^.....^...^.^.^.^...^.^.^...^...^.^.^.^.^.....^...^...^.^...^.^...^.^...^.^...^.^.^.^.^.^.....^.^.^.^.^.^.^.^...^.^.^.^.^...^.^.^.^.
.............................................................................................................................................

1000
Inputs/Day8.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
namespace AdventOfCode;
public static partial class StringExtensions
public static class StringExtensions
{
public static IEnumerable<string> ReadAllLines(this StringReader reader)
{
@@ -14,4 +14,25 @@ public static partial class StringExtensions
{
return new StringReader(text).ReadAllLines();
}
public static char[,] AsCharGrid(this string text)
{
var lines = text.ReadAllLines().ToArray();
var lineCount = lines.Length;
var columnCount = lines[0].Length;
var grid = new char[lineCount, columnCount];
for (int i = 0; i < lineCount; i++)
{
var line = lines[i];
for (int j = 0; j < columnCount; j++)
{
grid[i, j] = line[j];
}
}
return grid;
}
}