(2017+2018+2020)

This commit is contained in:
2023-04-09 23:38:12 +02:00
54 changed files with 11057 additions and 0 deletions

63
.gitattributes vendored Normal file
View File

@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

View File

@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3537CE59-1C57-481B-85F7-3F2A1F0EDE1D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdventOfCode2017.Tests</RootNamespace>
<AssemblyName>AdventOfCode2017.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise />
</Choose>
<ItemGroup>
<Compile Include="Day01_Tests.cs" />
<Compile Include="Day02_Tests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdventOfCode2017\AdventOfCode2017.csproj">
<Project>{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}</Project>
<Name>AdventOfCode2017</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,106 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2017.Tests
{
[TestClass()]
public class Day01_Tests
{
#region ResolvePart1
[TestMethod()]
public void ResolvePart1__Test1()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart1(new string[] { "1122", });
Assert.AreEqual("3", result);
}
[TestMethod()]
public void ResolvePart1__Test2()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart1(new string[] { "1111", });
Assert.AreEqual("4", result);
}
[TestMethod()]
public void ResolvePart1__Test3()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart1(new string[] { "1234", });
Assert.AreEqual("0", result);
}
[TestMethod()]
public void ResolvePart1__Test4()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart1(new string[] { "91212129", });
Assert.AreEqual("9", result);
}
#endregion ResolvePart1
#region ResolvePart2
[TestMethod()]
public void ResolvePart2__Test1()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart2(new string[] { "1212", });
Assert.AreEqual("6", result);
}
[TestMethod()]
public void ResolvePart2__Test2()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart2(new string[] { "1221", });
Assert.AreEqual("0", result);
}
[TestMethod()]
public void ResolvePart2__Test3()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart2(new string[] { "123425", });
Assert.AreEqual("4", result);
}
[TestMethod()]
public void ResolvePart2__Test4()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart2(new string[] { "123123", });
Assert.AreEqual("12", result);
}
[TestMethod()]
public void ResolvePart2__Test5()
{
Day01 day01 = new Day01();
string result = day01.ResolvePart2(new string[] { "12131415", });
Assert.AreEqual("4", result);
}
#endregion ResolvePart2
}
}

View File

@@ -0,0 +1,36 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2017.Tests
{
[TestClass()]
public class Day02_Tests
{
[TestMethod()]
public void ResolvePart1__Test()
{
Day02 day02 = new Day02();
string result = day02.ResolvePart1(new string[] {
"5 1 9 5",
"7 5 3",
"2 4 6 8",
});
Assert.AreEqual("18", result);
}
[TestMethod()]
public void ResolvePart2__Test()
{
Day02 day02 = new Day02();
string result = day02.ResolvePart2(new string[] {
"5 9 2 8",
"9 4 7 3",
"3 8 6 5",
});
Assert.AreEqual("9", result);
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// La información general de un ensamblado se controla mediante el siguiente
// conjunto de atributos. Cambie estos valores de atributo para modificar la información
// asociada con un ensamblado.
[assembly: AssemblyTitle("AdventOfCode2017.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdventOfCode2017.Tests")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles
// para los componentes COM. Si es necesario obtener acceso a un tipo en este ensamblado desde
// COM, establezca el atributo ComVisible en true en este tipo.
[assembly: ComVisible(false)]
// El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM.
[assembly: Guid("3537ce59-1c57-481b-85f7-3f2a1f0ede1d")]
// La información de versión de un ensamblado consta de los cuatro valores siguientes:
//
// Versión principal
// Versión secundaria
// Número de compilación
// Revisión
//
// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
// mediante el carácter '*', como se muestra a continuación:
//[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net461" />
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net461" />
</packages>

31
AdventOfCode2017.sln Normal file
View File

@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventOfCode2017", "AdventOfCode2017\AdventOfCode2017.csproj", "{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventOfCode2017.Tests", "AdventOfCode2017.Tests\AdventOfCode2017.Tests.csproj", "{3537CE59-1C57-481B-85F7-3F2A1F0EDE1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}.Release|Any CPU.Build.0 = Release|Any CPU
{3537CE59-1C57-481B-85F7-3F2A1F0EDE1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3537CE59-1C57-481B-85F7-3F2A1F0EDE1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3537CE59-1C57-481B-85F7-3F2A1F0EDE1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3537CE59-1C57-481B-85F7-3F2A1F0EDE1D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1D80D845-47C9-4610-BA3D-DCAAAD773CA1}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{49C8A67C-D94C-4CFB-B7FB-C19A1A83CA66}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>AdventOfCode2017</RootNamespace>
<AssemblyName>AdventOfCode2017</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Day01.cs" />
<Compile Include="Day02.cs" />
<Compile Include="Day03.cs" />
<Compile Include="IDay.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="inputs\Day01.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="inputs\Day02.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

80
AdventOfCode2017/Day01.cs Normal file
View File

@@ -0,0 +1,80 @@
namespace AdventOfCode2017
{
/*
*
--- Day 1: Inverse Captcha ---
The night before Christmas, one of Santa's Elves calls you in a panic. "The printer's broken! We can't print the Naughty or Nice List!" By the time you make it to sub-basement 17, there are only a few minutes until midnight. "We have a big problem," she says; "there must be almost fifty bugs in this system, but nothing else can print The List. Stand in this square, quick! There's no time to explain; if you can convince them to pay you in stars, you'll be able to--" She pulls a lever and the world goes blurry.
When your eyes can focus again, everything seems a lot more pixelated than before. She must have sent you inside the computer! You check the system clock: 25 milliseconds until midnight. With that much time, you should be able to collect all fifty stars by December 25th.
Collect stars by solving puzzles. Two puzzles will be made available on each day millisecond in the advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
You're standing in a room with "digitization quarantine" written in LEDs along one wall. The only door is locked, but it includes a small interface. "Restricted Area - Strictly No Digitized Users Allowed."
It goes on to explain that you may only leave by solving a captcha to prove you're not a human. Apparently, you only get one millisecond to solve the captcha: too fast for a normal human, but it feels like hours to you.
The captcha requires you to review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list.
For example:
1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit.
1111 produces 4 because each digit (all 1) matches the next.
1234 produces 0 because no digit matches the next.
91212129 produces 9 because the only digit that matches the next one is the last digit, 9.
What is the solution to your captcha?
--- Part Two ---
You notice a progress bar that jumps to 50% completion. Apparently, the door isn't yet satisfied, but it did emit a star as encouragement. The instructions change:
Now, instead of considering the next digit, it wants you to consider the digit halfway around the circular list. That is, if your list contains 10 items, only include a digit in your sum if the digit 10/2 = 5 steps forward matches it. Fortunately, your list has an even number of elements.
For example:
1212 produces 6: the list contains 4 items, and all four digits match the digit 2 items ahead.
1221 produces 0, because every comparison is between a 1 and a 2.
123425 produces 4, because both 2s match each other, but no other digit has a match.
123123 produces 12.
12131415 produces 4.
What is the solution to your new captcha?
*/
public class Day01 : IDay
{
public string ResolvePart1(string[] inputs)
{
string input = inputs[0];
int value = 0;
for(int i = 0; i < input.Length; i++)
{
int nextI = (i + 1) % input.Length;
if(input[i] == input[nextI])
{
value += (input[i] - '0');
}
}
return value.ToString();
}
public string ResolvePart2(string[] inputs)
{
string input = inputs[0];
int value = 0;
int inputLength = input.Length;
int inputHalfLength = inputLength / 2;
for (int i = 0; i < inputLength; i++)
{
int nextI = (i + inputHalfLength) % inputLength;
if (input[i] == input[nextI])
{
value += (input[i] - '0');
}
}
return value.ToString();
}
}
}

99
AdventOfCode2017/Day02.cs Normal file
View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdventOfCode2017
{
/*
--- Day 2: Corruption Checksum ---
As you walk through the door, a glowing humanoid shape yells in your direction. "You there! Your state appears to be idle. Come help us repair the corruption in this spreadsheet - if we take another millisecond, we'll have to display an hourglass cursor!"
The spreadsheet consists of rows of apparently-random numbers. To make sure the recovery process is on the right track, they need you to calculate the spreadsheet's checksum. For each row, determine the difference between the largest value and the smallest value; the checksum is the sum of all of these differences.
For example, given the following spreadsheet:
5 1 9 5
7 5 3
2 4 6 8
The first row's largest and smallest values are 9 and 1, and their difference is 8.
The second row's largest and smallest values are 7 and 3, and their difference is 4.
The third row's difference is 6.
In this example, the spreadsheet's checksum would be 8 + 4 + 6 = 18.
What is the checksum for the spreadsheet in your puzzle input?
--- Part Two ---
"Great work; looks like we're on the right track after all. Here's a star for your effort." However, the program seems a little worried. Can programs be worried?
"Based on what we're seeing, it looks like all the User wanted is some information about the evenly divisible values in the spreadsheet. Unfortunately, none of us are equipped for that kind of calculation - most of us specialize in bitwise operations."
It sounds like the goal is to find the only two numbers in each row where one evenly divides the other - that is, where the result of the division operation is a whole number. They would like you to find those numbers on each line, divide them, and add up each line's result.
For example, given the following spreadsheet:
5 9 2 8
9 4 7 3
3 8 6 5
In the first row, the only two numbers that evenly divide are 8 and 2; the result of this division is 4.
In the second row, the two numbers are 9 and 3; the result is 3.
In the third row, the result is 2.
In this example, the sum of the results would be 4 + 3 + 2 = 9.
What is the sum of each row's result in your puzzle input?
*/
public class Day02 : IDay
{
public string ResolvePart1(string[] inputs)
{
int checksum = 0;
foreach(string input in inputs)
{
int[] row = input
.Split(new string[] { " ", " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(cell => Convert.ToInt32(cell))
.ToArray();
int max = row.Max();
int min = row.Min();
checksum += (max - min);
}
return checksum.ToString();
}
public string ResolvePart2(string[] inputs)
{
int checksum = 0;
foreach (string input in inputs)
{
int[] row = input
.Split(new string[] { " ", " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(cell => Convert.ToInt32(cell))
.ToArray();
for (int i = 0; i < (row.Length - 1); i++)
{
for (int j = i + 1; j < row.Length; j++)
{
int max = Math.Max(row[i], row[j]);
int min = Math.Min(row[i], row[j]);
if ((max % min) == 0)
{
checksum += (max / min);
}
}
}
}
return checksum.ToString();
}
}
}

47
AdventOfCode2017/Day03.cs Normal file
View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdventOfCode2017
{
/*
*
--- Day 3: Spiral Memory ---
You come across an experimental new kind of memory stored on an infinite two-dimensional grid.
Each square on the grid is allocated in a spiral pattern starting at a location marked 1 and then counting up while spiraling outward. For example, the first few squares are allocated like this:
17 16 15 14 13
18 5 4 3 12
19 6 1 2 11
20 7 8 9 10
21 22 23---> ...
While this is very space-efficient (no squares are skipped), requested data must be carried back to square 1 (the location of the only access port for this memory system) by programs that can only move up, down, left, or right. They always take the shortest path: the Manhattan Distance between the location of the data and square 1.
For example:
Data from square 1 is carried 0 steps, since it's at the access port.
Data from square 12 is carried 3 steps, such as: down, left, left.
Data from square 23 is carried only 2 steps: up twice.
Data from square 1024 must be carried 31 steps.
How many steps are required to carry the data from the square identified in your puzzle input all the way to the access port?
*/
public class Day03 : IDay
{
public string ResolvePart1(string[] inputs)
{
return null;
}
public string ResolvePart2(string[] inputs)
{
return null;
}
}
}

8
AdventOfCode2017/IDay.cs Normal file
View File

@@ -0,0 +1,8 @@
namespace AdventOfCode2017
{
public interface IDay
{
string ResolvePart1(string[] inputs);
string ResolvePart2(string[] inputs);
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.IO;
namespace AdventOfCode2017
{
public class Program
{
private static void Main(string[] args)
{
int currentDayNumber = 3;
IDay currentDay = null;
switch (currentDayNumber)
{
case 1: currentDay = new Day01(); break;
case 2: currentDay = new Day02(); break;
case 3: currentDay = new Day03(); break;
}
string[] linesDay = File.ReadAllLines(string.Format("inputs/Day{0:00}.txt", currentDayNumber));
string resultPart1 = currentDay.ResolvePart1(linesDay);
Console.WriteLine("Day{1:00} Result Part1: {0}", resultPart1, currentDayNumber);
string resultPart2 = currentDay.ResolvePart2(linesDay);
Console.WriteLine("Day{1:00} Result Part2: {0}", resultPart2, currentDayNumber);
Console.Read();
}
}
}

View File

@@ -0,0 +1,15 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("AdventOfCode2017")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AdventOfCode2017")]
[assembly: AssemblyCopyright("Copyright © Valeriano A.R. 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("49c8a67c-d94c-4cfb-b7fb-c19a1a83ca66")]
[assembly: AssemblyFileVersion("1.0.0")]

View File

@@ -0,0 +1 @@
818275977931166178424892653779931342156567268946849597948944469863818248114327524824136924486891794739281668741616818614613222585132742386168687517939432911753846817997473555693821316918473474459788714917665794336753628836231159578734813485687247273288926216976992516314415836985611354682821892793983922755395577592859959966574329787693934242233159947846757279523939217844194346599494858459582798326799512571365294673978955928416955127211624234143497546729348687844317864243859238665326784414349618985832259224761857371389133635711819476969854584123589566163491796442167815899539788237118339218699137497532932492226948892362554937381497389469981346971998271644362944839883953967698665427314592438958181697639594631142991156327257413186621923369632466918836951277519421695264986942261781256412377711245825379412978876134267384793694756732246799739464721215446477972737883445615664755923441441781128933369585655925615257548499628878242122434979197969569971961379367756499884537433839217835728263798431874654317137955175565253555735968376115749641527957935691487965161211853476747758982854811367422656321836839326818976668191525884763294465366151349347633968321457954152621175837754723675485348339261288195865348545793575843874731785852718281311481217515834822185477982342271937155479432673815629144664144538221768992733498856934255518875381672342521819499939835919827166318715849161715775427981485233467222586764392783699273452228728667175488552924399518855743923659815483988899924199449721321589476864161778841352853573584489497263216627369841455165476954483715112127465311353411346132671561568444626828453687183385215975319858714144975174516356117245993696521941589168394574287785233685284294357548156487538175462176268162852746996633977948755296869616778577327951858348313582783675149343562362974553976147259225311183729415381527435926224781181987111454447371894645359797229493458443522549386769845742557644349554641538488252581267341635761715674381775778868374988451463624332123361576518411234438681171864923916896987836734129295354684962897616358722633724198278552339794629939574841672355699222747886785616814449297817352118452284785694551841431869545321438468118

View File

@@ -0,0 +1,16 @@
1919 2959 82 507 3219 239 3494 1440 3107 259 3544 683 207 562 276 2963
587 878 229 2465 2575 1367 2017 154 152 157 2420 2480 138 2512 2605 876
744 6916 1853 1044 2831 4797 213 4874 187 6051 6086 7768 5571 6203 247 285
1210 1207 1130 116 1141 563 1056 155 227 1085 697 735 192 1236 1065 156
682 883 187 307 269 673 290 693 199 132 505 206 231 200 760 612
1520 95 1664 1256 685 1446 253 88 92 313 754 1402 734 716 342 107
146 1169 159 3045 163 3192 1543 312 161 3504 3346 3231 771 3430 3355 3537
177 2129 3507 3635 2588 3735 3130 980 324 266 1130 3753 175 229 517 3893
4532 164 191 5169 4960 3349 3784 3130 5348 5036 2110 151 5356 193 1380 3580
2544 3199 3284 3009 3400 953 3344 3513 102 1532 161 143 2172 2845 136 2092
194 5189 3610 4019 210 256 5178 4485 5815 5329 5457 248 5204 4863 5880 3754
3140 4431 4534 4782 3043 209 216 5209 174 161 3313 5046 1160 160 4036 111
2533 140 4383 1581 139 141 2151 2104 2753 4524 4712 866 3338 2189 116 4677
1240 45 254 1008 1186 306 633 1232 1457 808 248 1166 775 1418 1175 287
851 132 939 1563 539 1351 1147 117 1484 100 123 490 152 798 1476 543
1158 2832 697 113 121 397 1508 118 2181 2122 809 2917 134 2824 3154 2791

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AdventOfCode2020\AdventOfCode2020.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,50 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day01_Tests
{
#region ResolvePart1
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day01();
string result = day.ResolvePart1(new string[] {
"1721",
"979",
"366",
"299",
"675",
"1456",
});
Assert.AreEqual("514579", result);
}
#endregion ResolvePart1
#region ResolvePart2
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day01();
string result = day.ResolvePart2(new string[] {
"1721",
"979",
"366",
"299",
"675",
"1456",
});
Assert.AreEqual("241861950", result);
}
#endregion ResolvePart2
}
}

View File

@@ -0,0 +1,44 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day02_Tests
{
#region ResolvePart1
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day02();
string result = day.ResolvePart1(new string[] {
"1-3 a: abcde",
"1-3 b: cdefg",
"2-9 c: ccccccccc",
});
Assert.AreEqual("2", result);
}
#endregion ResolvePart1
#region ResolvePart2
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day02();
string result = day.ResolvePart2(new string[] {
"1-3 a: abcde",
"1-3 b: cdefg",
"2-9 c: ccccccccc",
});
Assert.AreEqual("1", result);
}
#endregion ResolvePart1
}
}

View File

@@ -0,0 +1,52 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day03_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day03();
string result = day.ResolvePart1(new string[] {
"..##.......",
"#...#...#..",
".#....#..#.",
"..#.#...#.#",
".#...##..#.",
"..#.##.....",
".#.#.#....#",
".#........#",
"#.##...#...",
"#...##....#",
".#..#...#.#",
});
Assert.AreEqual("7", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day03();
string result = day.ResolvePart2(new string[] {
"..##.......",
"#...#...#..",
".#....#..#.",
"..#.#...#.#",
".#...##..#.",
"..#.##.....",
".#.#.#....#",
".#........#",
"#.##...#...",
"#...##....#",
".#..#...#.#",
});
Assert.AreEqual("336", result);
}
}
}

View File

@@ -0,0 +1,79 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day04_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day04();
string result = day.ResolvePart1(new string[] {
"ecl:gry pid:860033327 eyr:2020 hcl:#fffffd",
"byr:1937 iyr:2017 cid:147 hgt:183cm",
"",
"iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884",
"hcl:#cfa07d byr:1929",
"",
"hcl:#ae17e1 iyr:2013",
"eyr:2024",
"ecl:brn pid:760753108 byr:1931",
"hgt:179cm",
"",
"hcl:#cfa07d eyr:2025 pid:166559648",
"iyr:2011 ecl:brn hgt:59in",
});
Assert.AreEqual("2", result);
}
[TestMethod()]
public void ResolvePart2__ExampleInvalid()
{
var day = new Day04();
string result = day.ResolvePart2(new string[] {
"eyr:1972 cid:100",
"hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926",
"",
"iyr:2019",
"hcl:#602927 eyr:1967 hgt:170cm",
"ecl:grn pid:012533040 byr:1946",
"",
"hcl:dab227 iyr:2012",
"ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277",
"",
"hgt:59cm ecl:zzz",
"eyr:2038 hcl:74454a iyr:2023",
"pid:3556412378 byr:2007",
});
Assert.AreEqual("0", result);
}
[TestMethod()]
public void ResolvePart2__ExampleValid()
{
var day = new Day04();
string result = day.ResolvePart2(new string[] {
"pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980",
"hcl:#623a2f",
"",
"eyr:2029 ecl:blu cid:129 byr:1989",
"iyr:2014 pid:896056539 hcl:#a97842 hgt:165cm",
"",
"hcl:#888785",
"hgt:164cm byr:2001 iyr:2015 cid:88",
"pid:545766238 ecl:hzl",
"eyr:2022",
"",
"iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719",
});
Assert.AreEqual("4", result);
}
}
}

View File

@@ -0,0 +1,56 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day05_Tests
{
[TestMethod()]
public void ResolvePart1__Example1()
{
var day = new Day05();
string result = day.ResolvePart1(new string[] {
"FBFBBFFRLR",
});
Assert.AreEqual("357", result);
}
[TestMethod()]
public void ResolvePart1__Example2()
{
var day = new Day05();
string result = day.ResolvePart1(new string[] {
"BFFFBBFRRR",
});
Assert.AreEqual("567", result);
}
[TestMethod()]
public void ResolvePart1__Example3()
{
var day = new Day05();
string result = day.ResolvePart1(new string[] {
"FFFBBBFRRR",
});
Assert.AreEqual("119", result);
}
[TestMethod()]
public void ResolvePart1__Example4()
{
var day = new Day05();
string result = day.ResolvePart1(new string[] {
"BBFFBBFRLL",
});
Assert.AreEqual("820", result);
}
}
}

View File

@@ -0,0 +1,60 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day06_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day06();
string result = day.ResolvePart1(new string[] {
"abc",
"",
"a",
"b",
"c",
"",
"ab",
"ac",
"",
"a",
"a",
"a",
"a",
"",
"b",
});
Assert.AreEqual("11", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day06();
string result = day.ResolvePart2(new string[] {
"abc",
"",
"a",
"b",
"c",
"",
"ab",
"ac",
"",
"a",
"a",
"a",
"a",
"",
"b",
});
Assert.AreEqual("6", result);
}
}
}

View File

@@ -0,0 +1,46 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day07_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day07();
string result = day.ResolvePart1(new string[] {
"light red bags contain 1 bright white bag, 2 muted yellow bags.",
"dark orange bags contain 3 bright white bags, 4 muted yellow bags.",
"bright white bags contain 1 shiny gold bag.",
"muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.",
"shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.",
"dark olive bags contain 3 faded blue bags, 4 dotted black bags.",
"vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.",
"faded blue bags contain no other bags.",
"dotted black bags contain no other bags.",
});
Assert.AreEqual("4", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day07();
string result = day.ResolvePart2(new string[] {
"shiny gold bags contain 2 dark red bags.",
"dark red bags contain 2 dark orange bags.",
"dark orange bags contain 2 dark yellow bags.",
"dark yellow bags contain 2 dark green bags.",
"dark green bags contain 2 dark blue bags.",
"dark blue bags contain 2 dark violet bags.",
"dark violet bags contain no other bags.",
});
Assert.AreEqual("126", result);
}
}
}

View File

@@ -0,0 +1,48 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day08_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day08();
string result = day.ResolvePart1(new string[] {
"nop +0",
"acc +1",
"jmp +4",
"acc +3",
"jmp -3",
"acc -99",
"acc +1",
"jmp -4",
"acc +6",
});
Assert.AreEqual("5", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day08();
string result = day.ResolvePart2(new string[] {
"nop +0",
"acc +1",
"jmp +4",
"acc +3",
"jmp -3",
"acc -99",
"acc +1",
"jmp -4",
"acc +6",
});
Assert.AreEqual("8", result);
}
}
}

View File

@@ -0,0 +1,70 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day09_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day09();
string result = day.ResolvePart1(new string[] {
"35",
"20",
"15",
"25",
"47",
"40",
"62",
"55",
"65",
"95",
"102",
"117",
"150",
"182",
"127",
"219",
"299",
"277",
"309",
"576",
});
Assert.AreEqual("127", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day09();
string result = day.ResolvePart2(new string[] {
"35",
"20",
"15",
"25",
"47",
"40",
"62",
"55",
"65",
"95",
"102",
"117",
"150",
"182",
"127",
"219",
"299",
"277",
"309",
"576",
});
Assert.AreEqual("62", result);
}
}
}

View File

@@ -0,0 +1,46 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day10_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day10();
string result = day.ResolvePart1(new string[] {
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
});
Assert.AreEqual("YYY", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day09();
string result = day.ResolvePart2(new string[] {
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
});
Assert.AreEqual("YYY", result);
}
}
}

View File

@@ -0,0 +1,46 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AdventOfCode2020.Tests
{
[TestClass()]
public class Day11_Tests
{
[TestMethod()]
public void ResolvePart1__Example()
{
var day = new Day11();
string result = day.ResolvePart1(new string[] {
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
});
Assert.AreEqual("YYY", result);
}
[TestMethod()]
public void ResolvePart2__Example()
{
var day = new Day11();
string result = day.ResolvePart2(new string[] {
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXX",
});
Assert.AreEqual("YYY", result);
}
}
}

31
AdventOfCode2020.sln Normal file
View File

@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode2020", "AdventOfCode2020\AdventOfCode2020.csproj", "{CD1829F6-166D-4F78-AB95-C58916F42494}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventOfCode2020.Tests", "AdventOfCode2020.Tests\AdventOfCode2020.Tests.csproj", "{2B079D7D-08D4-4FFB-A000-858FFDD945FA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CD1829F6-166D-4F78-AB95-C58916F42494}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD1829F6-166D-4F78-AB95-C58916F42494}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD1829F6-166D-4F78-AB95-C58916F42494}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD1829F6-166D-4F78-AB95-C58916F42494}.Release|Any CPU.Build.0 = Release|Any CPU
{2B079D7D-08D4-4FFB-A000-858FFDD945FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B079D7D-08D4-4FFB-A000-858FFDD945FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B079D7D-08D4-4FFB-A000-858FFDD945FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B079D7D-08D4-4FFB-A000-858FFDD945FA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BAE59D7-7AFF-42B6-A391-CD22CD443B03}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Update="inputs\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

89
AdventOfCode2020/Day01.cs Normal file
View File

@@ -0,0 +1,89 @@
using System;
namespace AdventOfCode2020
{
/*
--- Day 1: Report Repair ---
After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you.
The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars. None of the currency exchanges seem to have heard of them, but somehow, you'll need to find fifty of these coins by the time you arrive so you can pay the deposit on your room.
To save your vacation, you need to get all fifty stars by December 25th.
Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
Before you leave, the Elves in accounting just need you to fix your expense report (your puzzle input); apparently, something isn't quite adding up.
Specifically, they need you to find the two entries that sum to 2020 and then multiply those two numbers together.
For example, suppose your expense report contained the following:
1721
979
366
299
675
1456
In this list, the two entries that sum to 2020 are 1721 and 299. Multiplying them together produces 1721 * 299 = 514579, so the correct answer is 514579.
Of course, your expense report is much larger. Find the two entries that sum to 2020; what do you get if you multiply them together?
--- Part Two ---
The Elves in accounting are thankful for your help; one of them even offers you a starfish coin they had left over from a past vacation. They offer you a second one if you can find three numbers in your expense report that meet the same criteria.
Using the above example again, the three entries that sum to 2020 are 979, 366, and 675. Multiplying them together produces the answer, 241861950.
In your expense report, what is the product of the three entries that sum to 2020?
*/
public class Day01 : IDay
{
public string ResolvePart1(string[] inputs)
{
int result = -1;
for (int i = 0; i < (inputs.Length - 1) && result < 0; i++)
{
for (int j = i + 1; j < inputs.Length && result < 0; j++)
{
if (string.IsNullOrEmpty(inputs[i]) || string.IsNullOrEmpty(inputs[j])) { continue; }
int numI = Convert.ToInt32(inputs[i]);
int numJ = Convert.ToInt32(inputs[j]);
if ((numI + numJ) == 2020)
{
result = numI * numJ;
}
}
}
return result.ToString();
}
public string ResolvePart2(string[] inputs)
{
long result = -1;
for (int i = 0; i < (inputs.Length - 2) && result < 0; i++)
{
for (int j = i + 1; j < (inputs.Length - 1) && result < 0; j++)
{
for (int k = j + 1; k < inputs.Length && result < 0; k++)
{
if (string.IsNullOrEmpty(inputs[i]) || string.IsNullOrEmpty(inputs[j]) || string.IsNullOrEmpty(inputs[k])) { continue; }
long numI = Convert.ToInt64(inputs[i]);
long numJ = Convert.ToInt64(inputs[j]);
long numK = Convert.ToInt64(inputs[k]);
if ((numI + numJ + numK) == 2020)
{
result = numI * numJ * numK;
}
}
}
}
return result.ToString();
}
}
}

92
AdventOfCode2020/Day02.cs Normal file
View File

@@ -0,0 +1,92 @@
using System;
using System.Linq;
namespace AdventOfCode2020
{
/*
--- Day 2: Password Philosophy ---
Your flight departs in a few days from the coastal airport; the easiest way down to the coast from here is via toboggan.
The shopkeeper at the North Pole Toboggan Rental Shop is having a bad day. "Something's wrong with our computers; we can't log in!" You ask if you can take a look.
Their password database seems to be a little corrupted: some of the passwords wouldn't have been allowed by the Official Toboggan Corporate Policy that was in effect when they were chosen.
To try to debug the problem, they have created a list (your puzzle input) of passwords (according to the corrupted database) and the corporate policy when that password was set.
For example, suppose you have the following list:
1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc
Each line gives the password policy and then the password. The password policy indicates the lowest and highest number of times a given letter must appear for the password to be valid. For example, 1-3 a means that the password must contain a at least 1 time and at most 3 times.
In the above example, 2 passwords are valid. The middle password, cdefg, is not; it contains no instances of b, but needs at least 1. The first and third passwords are valid: they contain one a or nine c, both within the limits of their respective policies.
How many passwords are valid according to their policies?
--- Part Two ---
While it appears you validated the passwords correctly, they don't seem to be what the Official Toboggan Corporate Authentication System is expecting.
The shopkeeper suddenly realizes that he just accidentally explained the password policy rules from his old job at the sled rental place down the street! The Official Toboggan Corporate Policy actually works a little differently.
Each policy actually describes two positions in the password, where 1 means the first character, 2 means the second character, and so on. (Be careful; Toboggan Corporate Policies have no concept of "index zero"!) Exactly one of these positions must contain the given letter. Other occurrences of the letter are irrelevant for the purposes of policy enforcement.
Given the same example list from above:
1-3 a: abcde is valid: position 1 contains a and position 3 does not.
1-3 b: cdefg is invalid: neither position 1 nor position 3 contains b.
2-9 c: ccccccccc is invalid: both position 2 and position 9 contain c.
How many passwords are valid according to the new interpretation of the policies?
*/
public class Day02 : IDay
{
public string ResolvePart1(string[] inputs)
{
int cntValid = 0;
foreach (string input in inputs)
{
if (string.IsNullOrEmpty(input)) { continue; }
string[] parts = input.Split('-', ' ', ':');
int min = Convert.ToInt32(parts[0]);
int max = Convert.ToInt32(parts[1]);
string character = parts[2];
string password = parts[4];
int cnt = password.Count(c => c == character[0]);
if (cnt <= max && cnt >= min) { cntValid++; }
}
return cntValid.ToString();
}
public string ResolvePart2(string[] inputs)
{
int cntValid = 0;
foreach (string input in inputs)
{
if (string.IsNullOrEmpty(input)) { continue; }
string[] parts = input.Split('-', ' ', ':');
int index0 = Convert.ToInt32(parts[0]);
int index1 = Convert.ToInt32(parts[1]);
string character = parts[2];
string password = parts[4];
if (password.Length < index0 || password.Length < index1) { continue; }
bool hasIndex0 = (password[index0 - 1] == character[0]);
bool hasIndex1 = (password[index1 - 1] == character[0]);
if ((hasIndex0 && hasIndex1) || (hasIndex0 == false && hasIndex1 == false)) { continue; }
if (hasIndex0 || hasIndex1) { cntValid++; }
}
return cntValid.ToString();
}
}
}

117
AdventOfCode2020/Day03.cs Normal file
View File

@@ -0,0 +1,117 @@
/*
--- Day 3: Toboggan Trajectory ---
With the toboggan login problems resolved, you set off toward the airport. While travel by toboggan might be easy, it's certainly not safe: there's very minimal steering and the area is covered in trees. You'll need to see which angles will take you near the fewest trees.
Due to the local geology, trees in this area only grow on exact integer coordinates in a grid. You make a map (your puzzle input) of the open squares (.) and trees (#) you can see. For example:
..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#
These aren't the only trees, though; due to something you read about once involving arboreal genetics and biome stability, the same pattern repeats to the right many times:
..##.........##.........##.........##.........##.........##....... --->
#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..
.#....#..#..#....#..#..#....#..#..#....#..#..#....#..#..#....#..#.
..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#
.#...##..#..#...##..#..#...##..#..#...##..#..#...##..#..#...##..#.
..#.##.......#.##.......#.##.......#.##.......#.##.......#.##..... --->
.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#
.#........#.#........#.#........#.#........#.#........#.#........#
#.##...#...#.##...#...#.##...#...#.##...#...#.##...#...#.##...#...
#...##....##...##....##...##....##...##....##...##....##...##....#
.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.# --->
You start on the open square (.) in the top-left corner and need to reach the bottom (below the bottom-most row on your map).
The toboggan can only follow a few specific slopes (you opted for a cheaper model that prefers rational numbers); start by counting all the trees you would encounter for the slope right 3, down 1:
From your starting position at the top-left, check the position that is right 3 and down 1. Then, check the position that is right 3 and down 1 from there, and so on until you go past the bottom of the map.
The locations you'd check in the above example are marked here with O where there was an open square and X where there was a tree:
..##.........##.........##.........##.........##.........##....... --->
#..O#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..
.#....X..#..#....#..#..#....#..#..#....#..#..#....#..#..#....#..#.
..#.#...#O#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#
.#...##..#..X...##..#..#...##..#..#...##..#..#...##..#..#...##..#.
..#.##.......#.X#.......#.##.......#.##.......#.##.......#.##..... --->
.#.#.#....#.#.#.#.O..#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#
.#........#.#........X.#........#.#........#.#........#.#........#
#.##...#...#.##...#...#.X#...#...#.##...#...#.##...#...#.##...#...
#...##....##...##....##...#X....##...##....##...##....##...##....#
.#..#...#.#.#..#...#.#.#..#...X.#.#..#...#.#.#..#...#.#.#..#...#.# --->
In this example, traversing the map using this slope would cause you to encounter 7 trees.
Starting at the top-left corner of your map and following a slope of right 3 and down 1, how many trees would you encounter?
Part Two ---
Time to check the rest of the slopes - you need to minimize the probability of a sudden arboreal stop, after all.
Determine the number of trees you would encounter if, for each of the following slopes, you start at the top-left corner and traverse the map all the way to the bottom:
Right 1, down 1.
Right 3, down 1. (This is the slope you already checked.)
Right 5, down 1.
Right 7, down 1.
Right 1, down 2.
In the above example, these slopes would find 2, 7, 3, 4, and 2 tree(s) respectively; multiplied together, these produce the answer 336.
What do you get if you multiply together the number of trees encountered on each of the listed slopes?
*/
namespace AdventOfCode2020
{
public class Day03 : IDay
{
public string ResolvePart1(string[] inputs)
{
int treeCnt = FollowSlope(inputs, 3, 1);
return treeCnt.ToString();
}
public string ResolvePart2(string[] inputs)
{
int treeCnt1 = FollowSlope(inputs, 1, 1);
int treeCnt2 = FollowSlope(inputs, 3, 1);
int treeCnt3 = FollowSlope(inputs, 5, 1);
int treeCnt4 = FollowSlope(inputs, 7, 1);
int treeCnt5 = FollowSlope(inputs, 1, 2);
long treeMult = treeCnt1 * treeCnt2 * treeCnt3 * treeCnt4 * treeCnt5;
return treeMult.ToString();
}
private static int FollowSlope(string[] inputs, int dx, int dy)
{
int x = 0;
int y = 0;
int treeCnt = 0;
x += dx;
y += dy;
while (y < inputs.Length)
{
string input = inputs[y];
char c = input[x % input.Length];
if (c == '#') { treeCnt++; }
x += dx;
y += dy;
}
return treeCnt;
}
}
}

268
AdventOfCode2020/Day04.cs Normal file
View File

@@ -0,0 +1,268 @@
using System;
using System.Collections.Generic;
using System.Linq;
/*
--- Day 4: Passport Processing ---
You arrive at the airport only to realize that you grabbed your North Pole Credentials instead of your passport. While these documents are extremely similar, North Pole Credentials aren't issued by a country and therefore aren't actually valid documentation for travel in most of the world.
It seems like you're not the only one having problems, though; a very long line has formed for the automatic passport scanners, and the delay could upset your travel itinerary.
Due to some questionable network security, you realize you might be able to solve both of these problems at the same time.
The automatic passport scanners are slow because they're having trouble detecting which passports have all required fields. The expected fields are as follows:
byr (Birth Year)
iyr (Issue Year)
eyr (Expiration Year)
hgt (Height)
hcl (Hair Color)
ecl (Eye Color)
pid (Passport ID)
cid (Country ID)
Passport data is validated in batch files (your puzzle input). Each passport is represented as a sequence of key:value pairs separated by spaces or newlines. Passports are separated by blank lines.
Here is an example batch file containing four passports:
ecl:gry pid:860033327 eyr:2020 hcl:#fffffd
byr:1937 iyr:2017 cid:147 hgt:183cm
iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884
hcl:#cfa07d byr:1929
hcl:#ae17e1 iyr:2013
eyr:2024
ecl:brn pid:760753108 byr:1931
hgt:179cm
hcl:#cfa07d eyr:2025 pid:166559648
iyr:2011 ecl:brn hgt:59in
The first passport is valid - all eight fields are present. The second passport is invalid - it is missing hgt (the Height field).
The third passport is interesting; the only missing field is cid, so it looks like data from North Pole Credentials, not a passport at all! Surely, nobody would mind if you made the system temporarily ignore missing cid fields. Treat this "passport" as valid.
The fourth passport is missing two fields, cid and byr. Missing cid is fine, but missing any other field is not, so this passport is invalid.
According to the above rules, your improved system would report 2 valid passports.
Count the number of valid passports - those that have all required fields. Treat cid as optional. In your batch file, how many passports are valid?
--- Part Two ---
The line is moving more quickly now, but you overhear airport security talking about how passports with invalid data are getting through. Better add some data validation, quick!
You can continue to ignore the cid field, but each other field has strict rules about what values are valid for automatic validation:
byr (Birth Year) - four digits; at least 1920 and at most 2002.
iyr (Issue Year) - four digits; at least 2010 and at most 2020.
eyr (Expiration Year) - four digits; at least 2020 and at most 2030.
hgt (Height) - a number followed by either cm or in:
If cm, the number must be at least 150 and at most 193.
If in, the number must be at least 59 and at most 76.
hcl (Hair Color) - a # followed by exactly six characters 0-9 or a-f.
ecl (Eye Color) - exactly one of: amb blu brn gry grn hzl oth.
pid (Passport ID) - a nine-digit number, including leading zeroes.
cid (Country ID) - ignored, missing or not.
Your job is to count the passports where all required fields are both present and valid according to the above rules. Here are some example values:
byr valid: 2002
byr invalid: 2003
hgt valid: 60in
hgt valid: 190cm
hgt invalid: 190in
hgt invalid: 190
hcl valid: #123abc
hcl invalid: #123abz
hcl invalid: 123abc
ecl valid: brn
ecl invalid: wat
pid valid: 000000001
pid invalid: 0123456789
Here are some invalid passports:
eyr:1972 cid:100
hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926
iyr:2019
hcl:#602927 eyr:1967 hgt:170cm
ecl:grn pid:012533040 byr:1946
hcl:dab227 iyr:2012
ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277
hgt:59cm ecl:zzz
eyr:2038 hcl:74454a iyr:2023
pid:3556412378 byr:2007
Here are some valid passports:
pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980
hcl:#623a2f
eyr:2029 ecl:blu cid:129 byr:1989
iyr:2014 pid:896056539 hcl:#a97842 hgt:165cm
hcl:#888785
hgt:164cm byr:2001 iyr:2015 cid:88
pid:545766238 ecl:hzl
eyr:2022
iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719
Count the number of valid passports - those that have all required fields and valid values. Continue to treat cid as optional. In your batch file, how many passports are valid?
*/
namespace AdventOfCode2020
{
public class Day04 : IDay
{
public string ResolvePart1(string[] inputs)
{
List<Dictionary<string, string>> passports = Passports_Parse(inputs);
int cnt = 0;
List<string> neededFields = new List<string>
{
"byr", // Birth Year
"iyr", // Issue Year
"eyr", // Expiration Year
"hgt", // Height
"hcl", // Hair Color
"ecl", // Eye Color
"pid", // Passport ID
};
foreach (Dictionary<string, string> passport in passports)
{
bool valid = true;
foreach (string field in neededFields)
{
if (passport.ContainsKey(field) == false)
{
valid = false;
break;
}
}
if (valid) { cnt++; }
}
return cnt.ToString();
}
public string ResolvePart2(string[] inputs)
{
List<Dictionary<string, string>> passports = Passports_Parse(inputs);
int cnt = 0;
foreach (Dictionary<string, string> passport in passports)
{
if (Passport_Validate(passport) == false) { continue; }
cnt++;
}
return cnt.ToString();
}
private List<Dictionary<string, string>> Passports_Parse(string[] inputs)
{
List<Dictionary<string, string>> passports = new List<Dictionary<string, string>>();
Dictionary<string, string> passport = new Dictionary<string, string>();
foreach (string input in inputs)
{
if (string.IsNullOrEmpty(input))
{
if (passport.Count > 0)
{
passports.Add(passport);
passport = new Dictionary<string, string>();
}
continue;
}
string[] pairs = input.Split(' ');
foreach (string pair in pairs)
{
string[] data = pair.Split(':');
if (passport.ContainsKey(data[0]))
{
passport[data[0]] = data[1];
}
else
{
passport.Add(data[0], data[1]);
}
}
}
if (passport.Count > 0)
{
passports.Add(passport);
}
return passports;
}
private bool Passport_Validate(Dictionary<string, string> passport)
{
if (passport.ContainsKey("byr") == false) { return false; }
int? birthYear = Year_Parse(passport["byr"]);
if (birthYear == null || birthYear < 1920 || birthYear > 2002) { return false; }
if (passport.ContainsKey("iyr") == false) { return false; }
int? issueYear = Year_Parse(passport["iyr"]);
if (issueYear == null || issueYear < 2010 || issueYear > 2020) { return false; }
if (passport.ContainsKey("eyr") == false) { return false; }
int? expirationYear = Year_Parse(passport["eyr"]);
if (expirationYear == null || expirationYear < 2020 || expirationYear > 2030) { return false; }
if (passport.ContainsKey("hgt") == false) { return false; }
string strHeight = passport["hgt"];
if (strHeight.EndsWith("cm"))
{
string strHeightCm = strHeight.Substring(0, strHeight.Length - 2);
if (strHeightCm.All(char.IsNumber) == false) { return false; }
int heightCm = Convert.ToInt32(strHeightCm);
if (heightCm < 150 || heightCm > 193) { return false; }
}
else if (strHeight.EndsWith("in"))
{
string strHeightIn = strHeight.Substring(0, strHeight.Length - 2);
if (strHeightIn.All(char.IsNumber) == false) { return false; }
int heightIn = Convert.ToInt32(strHeightIn);
if (heightIn < 59 || heightIn > 76) { return false; }
}
else { return false; }
if (passport.ContainsKey("hcl") == false) { return false; }
string strHairColor = passport["hcl"];
if (strHairColor.StartsWith("#") == false) { return false; }
string strHairColorHex = strHairColor.Substring(1);
if (strHairColorHex.All(c => char.IsNumber(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) == false) { return false; }
if (passport.ContainsKey("ecl") == false) { return false; }
string strEyeColor = passport["ecl"];
if (strEyeColor != "amb" && strEyeColor != "blu" && strEyeColor != "brn" && strEyeColor != "gry" && strEyeColor != "grn" && strEyeColor != "hzl" && strEyeColor != "oth") { return false; }
if (passport.ContainsKey("pid") == false) { return false; }
string strPassportID = passport["pid"];
if (strPassportID.Length != 9) { return false; }
if (strPassportID.All(char.IsNumber) == false) { return false; }
return true;
}
private int? Year_Parse(string input)
{
if (input.Length != 4) { return null; }
if (input.All(char.IsNumber) == false) { return null; }
return Convert.ToInt32(input);
}
}
}

214
AdventOfCode2020/Day05.cs Normal file
View File

@@ -0,0 +1,214 @@
/*
--- Day 5: Binary Boarding ---
You board your plane only to discover a new problem: you dropped your boarding pass! You aren't sure which seat is yours, and all of the flight attendants are busy with the flood of people that suddenly made it through passport control.
You write a quick program to use your phone's camera to scan all of the nearby boarding passes (your puzzle input); perhaps you can find your seat through process of elimination.
Instead of zones or groups, this airline uses binary space partitioning to seat people. A seat might be specified like FBFBBFFRLR, where F means "front", B means "back", L means "left", and R means "right".
The first 7 characters will either be F or B; these specify exactly one of the 128 rows on the plane (numbered 0 through 127). Each letter tells you which half of a region the given seat is in. Start with the whole list of rows; the first letter indicates whether the seat is in the front (0 through 63) or the back (64 through 127). The next letter indicates which half of that region the seat is in, and so on until you're left with exactly one row.
For example, consider just the first seven characters of FBFBBFFRLR:
Start by considering the whole range, rows 0 through 127.
F means to take the lower half, keeping rows 0 through 63.
B means to take the upper half, keeping rows 32 through 63.
F means to take the lower half, keeping rows 32 through 47.
B means to take the upper half, keeping rows 40 through 47.
B keeps rows 44 through 47.
F keeps rows 44 through 45.
The final F keeps the lower of the two, row 44.
The last three characters will be either L or R; these specify exactly one of the 8 columns of seats on the plane (numbered 0 through 7). The same process as above proceeds again, this time with only three steps. L means to keep the lower half, while R means to keep the upper half.
For example, consider just the last 3 characters of FBFBBFFRLR:
Start by considering the whole range, columns 0 through 7.
R means to take the upper half, keeping columns 4 through 7.
L means to take the lower half, keeping columns 4 through 5.
The final R keeps the upper of the two, column 5.
So, decoding FBFBBFFRLR reveals that it is the seat at row 44, column 5.
Every seat also has a unique seat ID: multiply the row by 8, then add the column. In this example, the seat has ID 44 * 8 + 5 = 357.
Here are some other boarding passes:
BFFFBBFRRR: row 70, column 7, seat ID 567.
FFFBBBFRRR: row 14, column 7, seat ID 119.
BBFFBBFRLL: row 102, column 4, seat ID 820.
As a sanity check, look through your list of boarding passes. What is the highest seat ID on a boarding pass?
--- Part Two ---
Ding! The "fasten seat belt" signs have turned on. Time to find your seat.
It's a completely full flight, so your seat should be the only missing boarding pass in your list. However, there's a catch: some of the seats at the very front and back of the plane don't exist on this aircraft, so they'll be missing from your list as well.
Your seat wasn't at the very front or back, though; the seats with IDs +1 and -1 from yours will be in your list.
What is the ID of your seat?
*/
using System;
using System.Linq;
namespace AdventOfCode2020
{
public class Day05 : IDay
{
public string ResolvePart1(string[] inputs)
{
int maxSerialNumber = 0;
foreach (string input in inputs)
{
Seat seat = Seat_Parse(input);
if (seat == null) { continue; }
int newSerialNumber = seat.GetSerialNumber();
if (newSerialNumber > maxSerialNumber) { maxSerialNumber = newSerialNumber; }
}
return maxSerialNumber.ToString();
}
public string ResolvePart2(string[] inputs)
{
// Fill the seats
char[][] seats = new char[8][];
for (int i = 0; i < 8; i++)
{
seats[i] = new char[128];
for (int j = 0; j < 128; j++) { seats[i][j] = '.'; }
}
foreach (string input in inputs)
{
Seat seat = Seat_Parse(input);
if (seat == null) { continue; }
seats[seat.Column][seat.Row] = 'X';
}
// Show seats
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 128; j++)
{
Console.Write(seats[i][j]);
}
Console.WriteLine();
}
// Find my seat
int mySeatSerialNumber = -1;
for (int i = 0; i < 8 && mySeatSerialNumber < 0; i++)
{
for (int j = 0; j < 128 && mySeatSerialNumber < 0; j++)
{
if (seats[i][j] == '.')
{
int neighbourCount = 0;
for (int k = -1; k < 2; k++)
{
for (int l = -1; l < 2; l++)
{
int col = (i + k);
if (col < 0) { col += 8; }
if (col >= 8) { col -= 8; }
int row = (j + l);
if (row < 0) { row += 128; }
if (row >= 128) { row -= 128; }
if (seats[col][row] == 'X')
{
neighbourCount++;
}
}
}
if (neighbourCount == 8)
{
Seat mySeat = new Seat { Row = j, Column = i, };
mySeatSerialNumber = mySeat.GetSerialNumber();
}
}
}
}
return mySeatSerialNumber.ToString();
}
private class Range
{
public int Start { get; set; }
public int End { get; set; }
public void SplitLeft()
{
int len = End - Start;
int half = (len + 1) / 2;
End -= half;
}
public void SplitRight()
{
int len = End - Start;
int half = (len + 1) / 2;
Start += half;
}
}
private class Seat
{
public int Row { get; set; }
public int Column { get; set; }
public int GetSerialNumber()
{
return (Row * 8) + Column;
}
}
private Seat Seat_Parse(string input)
{
if (input.Length != 10 ||
input.All(c => c == 'F' || c == 'B' || c == 'L' || c == 'R') == false ||
false)
{
return null;
}
Seat seat = new Seat();
Range row = new Range { Start = 0, End = 127, };
for (int i = 0; i < 7; i++)
{
if (input[i] == 'F')
{
row.SplitLeft();
}
if (input[i] == 'B')
{
row.SplitRight();
}
}
seat.Row = row.Start;
Range column = new Range { Start = 0, End = 7, };
for (int i = 7; i < 10; i++)
{
if (input[i] == 'L')
{
column.SplitLeft();
}
if (input[i] == 'R')
{
column.SplitRight();
}
}
seat.Column = column.Start;
return seat;
}
}
}

130
AdventOfCode2020/Day06.cs Normal file
View File

@@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.Linq;
/*
--- Day 6: Custom Customs ---
As your flight approaches the regional airport where you'll switch to a much larger plane, customs declaration forms are distributed to the passengers.
The form asks a series of 26 yes-or-no questions marked a through z. All you need to do is identify the questions for which anyone in your group answers "yes". Since your group is just you, this doesn't take very long.
However, the person sitting next to you seems to be experiencing a language barrier and asks if you can help. For each of the people in their group, you write down the questions for which they answer "yes", one per line. For example:
abcx
abcy
abcz
In this group, there are 6 questions to which anyone answered "yes": a, b, c, x, y, and z. (Duplicate answers to the same question don't count extra; each question counts at most once.)
Another group asks for your help, then another, and eventually you've collected answers from every group on the plane (your puzzle input). Each group's answers are separated by a blank line, and within each group, each person's answers are on a single line. For example:
abc
a
b
c
ab
ac
a
a
a
a
b
This list represents answers from five groups:
The first group contains one person who answered "yes" to 3 questions: a, b, and c.
The second group contains three people; combined, they answered "yes" to 3 questions: a, b, and c.
The third group contains two people; combined, they answered "yes" to 3 questions: a, b, and c.
The fourth group contains four people; combined, they answered "yes" to only 1 question, a.
The last group contains one person who answered "yes" to only 1 question, b.
In this example, the sum of these counts is 3 + 3 + 3 + 1 + 1 = 11.
For each group, count the number of questions to which anyone answered "yes". What is the sum of those counts?
*/
namespace AdventOfCode2020
{
public class Day06 : IDay
{
public string ResolvePart1(string[] inputs)
{
Dictionary<char, bool> groupMap = new Dictionary<char, bool>();
List<Dictionary<char, bool>> groupMaps = new List<Dictionary<char, bool>>();
foreach (string input in inputs)
{
if (string.IsNullOrEmpty(input) && groupMap.Count > 0)
{
groupMaps.Add(groupMap);
groupMap = new Dictionary<char, bool>();
continue;
}
foreach (char c in input)
{
if (groupMap.ContainsKey(c) == false)
{
groupMap.Add(c, true);
}
}
}
if (groupMap.Count > 0)
{
groupMaps.Add(groupMap);
}
int total = groupMaps.Sum(groupMap => groupMap.Count);
return total.ToString();
}
public string ResolvePart2(string[] inputs)
{
int groupCount = 0;
Dictionary<char, int> groupMap = new Dictionary<char, int>();
List<Tuple<int, Dictionary<char, int>>> groupMaps = new List<Tuple<int, Dictionary<char, int>>>();
foreach (string input in inputs)
{
if (string.IsNullOrEmpty(input) && groupCount > 0)
{
groupMaps.Add(new Tuple<int, Dictionary<char, int>>(groupCount, groupMap));
groupCount = 0;
groupMap = new Dictionary<char, int>();
continue;
}
groupCount++;
foreach (char c in input)
{
if (groupMap.ContainsKey(c) == false)
{
groupMap.Add(c, 1);
}
else
{
groupMap[c] = groupMap[c] + 1;
}
}
}
if (groupCount > 0)
{
groupMaps.Add(new Tuple<int, Dictionary<char, int>>(groupCount, groupMap));
}
int total = groupMaps.Sum(group =>
{
return group.Item2.Count(p => p.Value == group.Item1);
});
return total.ToString();
}
}
}

207
AdventOfCode2020/Day07.cs Normal file
View File

@@ -0,0 +1,207 @@
using System;
using System.Collections.Generic;
using System.Linq;
/*
--- Day 7: Handy Haversacks ---
You land at the regional airport in time for your next flight. In fact, it looks like you'll even have time to grab some food: all flights are currently delayed due to issues in luggage processing.
Due to recent aviation regulations, many rules (your puzzle input) are being enforced about bags and their contents; bags must be color-coded and must contain specific quantities of other color-coded bags. Apparently, nobody responsible for these regulations considered how long they would take to enforce!
For example, consider the following rules:
light red bags contain 1 bright white bag, 2 muted yellow bags.
dark orange bags contain 3 bright white bags, 4 muted yellow bags.
bright white bags contain 1 shiny gold bag.
muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.
dark olive bags contain 3 faded blue bags, 4 dotted black bags.
vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.
faded blue bags contain no other bags.
dotted black bags contain no other bags.
These rules specify the required contents for 9 bag types. In this example, every faded blue bag is empty, every vibrant plum bag contains 11 bags (5 faded blue and 6 dotted black), and so on.
You have a shiny gold bag. If you wanted to carry it in at least one other bag, how many different bag colors would be valid for the outermost bag? (In other words: how many colors can, eventually, contain at least one shiny gold bag?)
In the above rules, the following options would be available to you:
A bright white bag, which can hold your shiny gold bag directly.
A muted yellow bag, which can hold your shiny gold bag directly, plus some other bags.
A dark orange bag, which can hold bright white and muted yellow bags, either of which could then hold your shiny gold bag.
A light red bag, which can hold bright white and muted yellow bags, either of which could then hold your shiny gold bag.
So, in this example, the number of bag colors that can eventually contain at least one shiny gold bag is 4.
How many bag colors can eventually contain at least one shiny gold bag? (The list of rules is quite long; make sure you get all of it.)
--- Part Two ---
It's getting pretty expensive to fly these days - not because of ticket prices, but because of the ridiculous number of bags you need to buy!
Consider again your shiny gold bag and the rules from the above example:
faded blue bags contain 0 other bags.
dotted black bags contain 0 other bags.
vibrant plum bags contain 11 other bags: 5 faded blue bags and 6 dotted black bags.
dark olive bags contain 7 other bags: 3 faded blue bags and 4 dotted black bags.
So, a single shiny gold bag must contain 1 dark olive bag (and the 7 bags within it) plus 2 vibrant plum bags (and the 11 bags within each of those): 1 + 1*7 + 2 + 2*11 = 32 bags!
Of course, the actual rules have a small chance of going several levels deeper than this example; be sure to count all of the bags, even if the nesting becomes topologically impractical!
Here's another example:
shiny gold bags contain 2 dark red bags.
dark red bags contain 2 dark orange bags.
dark orange bags contain 2 dark yellow bags.
dark yellow bags contain 2 dark green bags.
dark green bags contain 2 dark blue bags.
dark blue bags contain 2 dark violet bags.
dark violet bags contain no other bags.
In this example, a single shiny gold bag must contain 126 other bags.
How many individual bags are required inside your single shiny gold bag?
*/
namespace AdventOfCode2020
{
public class Day07 : IDay
{
public string ResolvePart1(string[] inputs)
{
string myBagColor = "shiny gold";
List<BaggageRule> rules = new List<BaggageRule>();
foreach (string input in inputs)
{
BaggageRule rule = BaggageRule_Parse(input);
rules.Add(rule);
}
List<string> bagColorsToCheck = new List<string> { myBagColor };
List<string> bagColorsChecked = new List<string> { myBagColor };
int cntBagColors = 0;
while (bagColorsToCheck.Count > 0)
{
string currentColor = bagColorsToCheck[0];
bagColorsToCheck.RemoveAt(0);
foreach (BaggageRule rule in rules)
{
if (rule.Contain.Any(r => r.BagColor == currentColor))
{
if (bagColorsChecked.Contains(rule.BagColor) == false)
{
bagColorsToCheck.Add(rule.BagColor);
bagColorsChecked.Add(rule.BagColor);
cntBagColors++;
}
}
}
}
return cntBagColors.ToString();
}
public string ResolvePart2(string[] inputs)
{
string myBagColor = "shiny gold";
List<BaggageRule> rules = new List<BaggageRule>();
foreach (string input in inputs)
{
BaggageRule rule = BaggageRule_Parse(input);
rules.Add(rule);
}
Dictionary<string, BaggageRule> dictRules = rules.ToDictionary(x => x.BagColor);
int cnt = BaggageRule_CountChilds(myBagColor, dictRules);
return cnt.ToString();
}
public class BaggageContainRule
{
public string BagColor { get; set; }
public int Count { get; set; }
}
public class BaggageRule
{
public string BagColor { get; set; }
public List<BaggageContainRule> Contain { get; set; }
}
public BaggageRule BaggageRule_Parse(string input)
{
string[] words = input.Split(' ');
string status = "Parse Color 1";
BaggageRule rule = new BaggageRule();
rule.Contain = new List<BaggageContainRule>();
BaggageContainRule containRule = null;
string color1 = string.Empty;
foreach (string word in words)
{
switch (status)
{
case "Parse Color 1":
color1 = word;
status = "Parse Color 2";
break;
case "Parse Color 2":
rule.BagColor = string.Concat(color1, " ", word);
status = "Expect bags";
break;
case "Expect bags":
if (word != "bags") { throw new Exception("Expecting bags"); }
status = "Expect contain";
break;
case "Expect contain":
if (word != "contain") { throw new Exception("Expecting contain"); }
status = "Parse Contain count";
break;
case "Parse Contain count":
if (word == "no") { status = "End"; break; }
containRule = new BaggageContainRule();
containRule.Count = Convert.ToInt32(word);
status = "Parse Contain color 1";
break;
case "Parse Contain color 1":
color1 = word;
status = "Parse Contain color 2";
break;
case "Parse Contain color 2":
containRule.BagColor = string.Concat(color1, " ", word);
rule.Contain.Add(containRule);
status = "Parse Contain continue";
break;
case "Parse Contain continue":
if (word == "bag," || word == "bags,") { status = "Parse Contain count"; break; }
status = "End";
break;
case "End":
break;
}
}
return rule;
}
public int BaggageRule_CountChilds(string color, Dictionary<string, BaggageRule> dictRules)
{
int cnt = 0;
BaggageRule rule = dictRules[color];
foreach (BaggageContainRule containRule in rule.Contain)
{
cnt += (BaggageRule_CountChilds(containRule.BagColor, dictRules) + 1) * containRule.Count;
}
return cnt;
}
}
}

229
AdventOfCode2020/Day08.cs Normal file
View File

@@ -0,0 +1,229 @@
using System;
using System.Collections.Generic;
/*
--- Day 8: Handheld Halting ---
Your flight to the major airline hub reaches cruising altitude without incident. While you consider checking the in-flight menu for one of those drinks that come with a little umbrella, you are interrupted by the kid sitting next to you.
Their handheld game console won't turn on! They ask if you can take a look.
You narrow the problem down to a strange infinite loop in the boot code (your puzzle input) of the device. You should be able to fix it, but first you need to be able to run the code in isolation.
The boot code is represented as a text file with one instruction per line of text. Each instruction consists of an operation (acc, jmp, or nop) and an argument (a signed number like +4 or -20).
acc increases or decreases a single global value called the accumulator by the value given in the argument. For example, acc +7 would increase the accumulator by 7. The accumulator starts at 0. After an acc instruction, the instruction immediately below it is executed next.
jmp jumps to a new instruction relative to itself. The next instruction to execute is found using the argument as an offset from the jmp instruction; for example, jmp +2 would skip the next instruction, jmp +1 would continue to the instruction immediately below it, and jmp -20 would cause the instruction 20 lines above to be executed next.
nop stands for No OPeration - it does nothing. The instruction immediately below it is executed next.
For example, consider the following program:
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
These instructions are visited in this order:
nop +0 | 1
acc +1 | 2, 8(!)
jmp +4 | 3
acc +3 | 6
jmp -3 | 7
acc -99 |
acc +1 | 4
jmp -4 | 5
acc +6 |
First, the nop +0 does nothing. Then, the accumulator is increased from 0 to 1 (acc +1) and jmp +4 sets the next instruction to the other acc +1 near the bottom. After it increases the accumulator from 1 to 2, jmp -4 executes, setting the next instruction to the only acc +3. It sets the accumulator to 5, and jmp -3 causes the program to continue back at the first acc +1.
This is an infinite loop: with this sequence of jumps, the program will run forever. The moment the program tries to run any instruction a second time, you know it will never terminate.
Immediately before the program would run an instruction a second time, the value in the accumulator is 5.
Run your copy of the boot code. Immediately before any instruction is executed a second time, what value is in the accumulator?
--- Part Two ---
After some careful analysis, you believe that exactly one instruction is corrupted.
Somewhere in the program, either a jmp is supposed to be a nop, or a nop is supposed to be a jmp. (No acc instructions were harmed in the corruption of this boot code.)
The program is supposed to terminate by attempting to execute an instruction immediately after the last instruction in the file. By changing exactly one jmp or nop, you can repair the boot code and make it terminate correctly.
For example, consider the same program from above:
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
If you change the first instruction from nop +0 to jmp +0, it would create a single-instruction infinite loop, never leaving that instruction. If you change almost any of the jmp instructions, the program will still eventually find another jmp instruction and loop forever.
However, if you change the second-to-last instruction (from jmp -4 to nop -4), the program terminates! The instructions are visited in this order:
nop +0 | 1
acc +1 | 2
jmp +4 | 3
acc +3 |
jmp -3 |
acc -99 |
acc +1 | 4
nop -4 | 5
acc +6 | 6
After the last instruction (acc +6), the program terminates by attempting to run the instruction below the last instruction in the file. With this change, after the program terminates, the accumulator contains the value 8 (acc +1, acc +1, acc +6).
Fix the program so that it terminates normally by changing exactly one jmp (to nop) or nop (to jmp). What is the value of the accumulator after the program terminates?
*/
namespace AdventOfCode2020
{
public class Day08 : IDay
{
public string ResolvePart1(string[] inputs)
{
VM vm = new VM(inputs);
vm.Run();
return vm.Accumulator.ToString();
}
public string ResolvePart2(string[] inputs)
{
VM vm = new VM(inputs);
foreach (Instruction instruction in vm.Instructions)
{
if (instruction.OpCode == OpCode.Acc) { continue; }
if (instruction.OpCode == OpCode.Nop)
{
instruction.OpCode = OpCode.Jmp;
vm.Run();
if (vm.Ended) { break; }
instruction.OpCode = OpCode.Nop;
}
if (instruction.OpCode == OpCode.Jmp)
{
instruction.OpCode = OpCode.Nop;
vm.Run();
if (vm.Ended) { break; }
instruction.OpCode = OpCode.Jmp;
}
}
return vm.Accumulator.ToString();
}
public enum OpCode
{
Acc,
Jmp,
Nop,
};
public class Instruction
{
public OpCode OpCode { get; set; }
public int Value { get; set; }
public bool Executed { get; set; }
public Instruction(string input)
{
string[] parts = input.Split(' ');
if (parts[0] == "acc")
{
OpCode = OpCode.Acc;
}
if (parts[0] == "jmp")
{
OpCode = OpCode.Jmp;
}
if (parts[0] == "nop")
{
OpCode = OpCode.Nop;
}
if (parts[1].StartsWith("+"))
{
Value = Convert.ToInt32(parts[1].Substring(1));
}
else
{
Value = Convert.ToInt32(parts[1]);
}
Executed = false;
}
}
public class VM
{
public List<Instruction> Instructions { get; set; }
public int Accumulator { get; set; }
public bool Ended { get; set; }
public VM(string[] inputs)
{
Instructions = new List<Instruction>();
foreach (string input in inputs)
{
Instructions.Add(new Instruction(input));
}
Accumulator = 0;
Ended = false;
}
public void Run()
{
foreach (Instruction instruction in Instructions)
{
instruction.Executed = false;
}
Ended = false;
Accumulator = 0;
int idx = 0;
while (Instructions[idx].Executed == false)
{
Instruction currentInstruction = Instructions[idx];
if (currentInstruction.OpCode == OpCode.Acc)
{
Accumulator += currentInstruction.Value;
currentInstruction.Executed = true;
idx++;
}
if (currentInstruction.OpCode == OpCode.Jmp)
{
currentInstruction.Executed = true;
idx += currentInstruction.Value;
}
if (currentInstruction.OpCode == OpCode.Nop)
{
currentInstruction.Executed = true;
idx++;
}
if (idx >= Instructions.Count)
{
Ended = true;
break;
}
}
}
}
}
}

173
AdventOfCode2020/Day09.cs Normal file
View File

@@ -0,0 +1,173 @@
using System;
using System.Collections.Generic;
using System.Linq;
/*
--- Day 9: Encoding Error ---
With your neighbor happily enjoying their video game, you turn your attention to an open data port on the little screen in the seat in front of you.
Though the port is non-standard, you manage to connect it to your computer through the clever use of several paperclips. Upon connection, the port outputs a series of numbers (your puzzle input).
The data appears to be encrypted with the eXchange-Masking Addition System (XMAS) which, conveniently for you, is an old cypher with an important weakness.
XMAS starts by transmitting a preamble of 25 numbers. After that, each number you receive should be the sum of any two of the 25 immediately previous numbers. The two numbers will have different values, and there might be more than one such pair.
For example, suppose your preamble consists of the numbers 1 through 25 in a random order. To be valid, the next number must be the sum of two of those numbers:
26 would be a valid next number, as it could be 1 plus 25 (or many other pairs, like 2 and 24).
49 would be a valid next number, as it is the sum of 24 and 25.
100 would not be valid; no two of the previous 25 numbers sum to 100.
50 would also not be valid; although 25 appears in the previous 25 numbers, the two numbers in the pair must be different.
Suppose the 26th number is 45, and the first number (no longer an option, as it is more than 25 numbers ago) was 20. Now, for the next number to be valid, there needs to be some pair of numbers among 1-19, 21-25, or 45 that add up to it:
26 would still be a valid next number, as 1 and 25 are still within the previous 25 numbers.
65 would not be valid, as no two of the available numbers sum to it.
64 and 66 would both be valid, as they are the result of 19+45 and 21+45 respectively.
Here is a larger example which only considers the previous 5 numbers (and has a preamble of length 5):
35
20
15
25
47
40
62
55
65
95
102
117
150
182
127
219
299
277
309
576
In this example, after the 5-number preamble, almost every number is the sum of two of the previous 5 numbers; the only number that does not follow this rule is 127.
The first step of attacking the weakness in the XMAS data is to find the first number in the list (after the preamble) which is not the sum of two of the 25 numbers before it. What is the first number that does not have this property?
--- Part Two ---
The final step in breaking the XMAS encryption relies on the invalid number you just found: you must find a contiguous set of at least two numbers in your list which sum to the invalid number from step 1.
Again consider the above example:
35
20
15
25
47
40
62
55
65
95
102
117
150
182
127
219
299
277
309
576
In this list, adding up all of the numbers from 15 through 40 produces the invalid number from step 1, 127. (Of course, the contiguous set of numbers in your actual list might be much longer.)
To find the encryption weakness, add together the smallest and largest number in this contiguous range; in this example, these are 15 and 47, producing 62.
What is the encryption weakness in your XMAS-encrypted list of numbers?
*/
namespace AdventOfCode2020
{
public class Day09 : IDay
{
public string ResolvePart1(string[] inputs)
{
int preamble = 25;
if (inputs.Length < preamble) { preamble = 5; }
List<long> numbers = inputs.Select(x => Convert.ToInt64(x)).ToList();
int firstInvalid = XMAS_FindFirstInvalid(preamble, numbers);
return numbers[firstInvalid].ToString();
}
public string ResolvePart2(string[] inputs)
{
int preamble = 25;
if (inputs.Length < preamble) { preamble = 5; }
List<long> numbers = inputs.Select(x => Convert.ToInt64(x)).ToList();
int firstInvalid = XMAS_FindFirstInvalid(preamble, numbers);
long numberInvalid = numbers[firstInvalid];
long numberChecksum = -1;
bool found = false;
for (int i = firstInvalid - 1; i > 0 && found == false; i--)
{
long sum = numbers[i];
long max = numbers[i];
long min = numbers[i];
for (int j = (i - 1); j >= 0 && found == false; j--)
{
sum += numbers[j];
if (numbers[j] > max) { max = numbers[j]; }
if (numbers[j] < min) { min = numbers[j]; }
if (sum == numberInvalid)
{
found = true;
numberChecksum = max + min;
}
if (sum > numberInvalid)
{
break;
}
}
}
return numberChecksum.ToString();
}
private static int XMAS_FindFirstInvalid(int preamble, List<long> numbers)
{
int firstInvalid = -1;
for (int i = preamble; i < numbers.Count; i++)
{
bool valid = false;
long number = numbers[i];
for (int j = (i - preamble); j < (i - 1) && valid == false; j++)
{
for (int k = (j + 1); k < i && valid == false; k++)
{
long sum = numbers[j] + numbers[k];
if (sum == number)
{
valid = true;
}
}
}
if (valid == false)
{
firstInvalid = i;
break;
}
}
return firstInvalid;
}
}
}

108
AdventOfCode2020/Day10.cs Normal file
View File

@@ -0,0 +1,108 @@
using System;
/*
--- Day 10: Adapter Array ---
Patched into the aircraft's data port, you discover weather forecasts of a massive tropical storm. Before you can figure out whether it will impact your vacation plans, however, your device suddenly turns off!
Its battery is dead.
You'll need to plug it in. There's only one problem: the charging outlet near your seat produces the wrong number of jolts. Always prepared, you make a list of all of the joltage adapters in your bag.
Each of your joltage adapters is rated for a specific output joltage (your puzzle input). Any given adapter can take an input 1, 2, or 3 jolts lower than its rating and still produce its rated output joltage.
In addition, your device has a built-in joltage adapter rated for 3 jolts higher than the highest-rated adapter in your bag. (If your adapter list were 3, 9, and 6, your device's built-in adapter would be rated for 12 jolts.)
Treat the charging outlet near your seat as having an effective joltage rating of 0.
Since you have some time to kill, you might as well test all of your adapters. Wouldn't want to get to your resort and realize you can't even charge your device!
If you use every adapter in your bag at once, what is the distribution of joltage differences between the charging outlet, the adapters, and your device?
For example, suppose that in your bag, you have adapters with the following joltage ratings:
16
10
15
5
1
11
7
19
6
12
4
With these adapters, your device's built-in joltage adapter would be rated for 19 + 3 = 22 jolts, 3 higher than the highest-rated adapter.
Because adapters can only connect to a source 1-3 jolts lower than its rating, in order to use every adapter, you'd need to choose them like this:
The charging outlet has an effective rating of 0 jolts, so the only adapters that could connect to it directly would need to have a joltage rating of 1, 2, or 3 jolts. Of these, only one you have is an adapter rated 1 jolt (difference of 1).
From your 1-jolt rated adapter, the only choice is your 4-jolt rated adapter (difference of 3).
From the 4-jolt rated adapter, the adapters rated 5, 6, or 7 are valid choices. However, in order to not skip any adapters, you have to pick the adapter rated 5 jolts (difference of 1).
Similarly, the next choices would need to be the adapter rated 6 and then the adapter rated 7 (with difference of 1 and 1).
The only adapter that works with the 7-jolt rated adapter is the one rated 10 jolts (difference of 3).
From 10, the choices are 11 or 12; choose 11 (difference of 1) and then 12 (difference of 1).
After 12, only valid adapter has a rating of 15 (difference of 3), then 16 (difference of 1), then 19 (difference of 3).
Finally, your device's built-in adapter is always 3 higher than the highest adapter, so its rating is 22 jolts (always a difference of 3).
In this example, when using every adapter, there are 7 differences of 1 jolt and 5 differences of 3 jolts.
Here is a larger example:
28
33
18
42
31
14
46
20
48
47
24
23
49
45
19
38
39
11
1
32
25
35
8
17
7
9
4
2
34
10
3
In this larger example, in a chain that uses all of the adapters, there are 22 differences of 1 jolt and 10 differences of 3 jolts.
Find a chain that uses all of your adapters to connect the charging outlet to your device's built-in adapter and count the joltage differences between the charging outlet, the adapters, and your device. What is the number of 1-jolt differences multiplied by the number of 3-jolt differences?
*/
namespace AdventOfCode2020
{
public class Day10 : IDay
{
public string ResolvePart1(string[] inputs)
{
throw new NotImplementedException();
}
public string ResolvePart2(string[] inputs)
{
throw new NotImplementedException();
}
}
}

24
AdventOfCode2020/Day11.cs Normal file
View File

@@ -0,0 +1,24 @@
using System;
/*
*/
namespace AdventOfCode2020
{
public class Day11 : IDay
{
public string ResolvePart1(string[] inputs)
{
throw new NotImplementedException();
}
public string ResolvePart2(string[] inputs)
{
throw new NotImplementedException();
}
}
}

8
AdventOfCode2020/IDay.cs Normal file
View File

@@ -0,0 +1,8 @@
namespace AdventOfCode2020
{
public interface IDay
{
string ResolvePart1(string[] inputs);
string ResolvePart2(string[] inputs);
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.IO;
namespace AdventOfCode2020
{
class Program
{
static void Main(string[] args)
{
int currentDayNumber = 0;
DateTime date = DateTime.UtcNow.AddHours(-5);
if (date.Month == 12 && currentDayNumber == 0)
{
currentDayNumber = date.Day;
}
RunDay(currentDayNumber);
Console.Read();
}
public static void RunDay(int currentDayNumber)
{
Console.WriteLine(string.Format("Day {0:00}", currentDayNumber));
Console.WriteLine("------");
Console.WriteLine();
IDay currentDay = null;
Type dayType = Type.GetType(string.Format("AdventOfCode2020.Day{0:00}", currentDayNumber));
if (dayType != null)
{
currentDay = Activator.CreateInstance(dayType) as IDay;
}
if (currentDay == null)
{
Console.WriteLine("!!!!!!!");
Console.WriteLine("Day implementation not found.");
return;
}
string[] linesDay = File.ReadAllLines(string.Format("inputs/Day{0:00}.txt", currentDayNumber));
try
{
string resultPart1 = currentDay.ResolvePart1(linesDay);
Console.WriteLine("Day{1:00} Result Part1: {0}", resultPart1, currentDayNumber);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
try
{
string resultPart2 = currentDay.ResolvePart2(linesDay);
Console.WriteLine("Day{1:00} Result Part2: {0}", resultPart2, currentDayNumber);
}
catch (Exception ex)
{
Console.WriteLine("!!!!!!!");
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}

View File

@@ -0,0 +1,200 @@
1293
1207
1623
1675
1842
1410
85
1108
557
1217
1506
1956
1579
1614
1360
1544
1946
1666
1972
1814
1699
1778
1529
2002
1768
1173
1407
1201
1264
1739
1774
1951
1980
1428
1381
1714
884
1939
1295
1694
1168
1971
1352
1462
1828
1402
1433
1542
1144
1331
1427
1261
1663
1820
1570
1874
1486
1613
1769
1721
1753
1142
1677
2010
1640
1465
1171
534
1790
2005
1604
1891
1247
1281
1867
1403
2004
1668
1416
2001
1359
686
1965
1728
1551
1565
1128
1832
1757
1350
1808
1711
1799
1590
1989
1547
1140
1905
1368
1179
1902
1473
1908
1859
1257
1394
1244
1800
1695
1731
1474
1781
1885
1154
1990
1929
1193
1302
1831
1226
1418
1400
1435
1645
1655
1843
1227
1481
1754
1290
1685
1498
71
1286
1137
1288
1758
1987
1471
1839
1545
1682
1615
1475
1849
1985
1568
1795
1184
1863
1362
1271
1802
1944
1821
1880
1788
1733
1150
1314
1727
1434
1833
1312
1457
160
1629
1967
1505
1239
1266
1838
1687
1630
1591
1893
1450
1234
1755
1523
1533
1499
1865
1725
1444
1517
1167
1738
1519
1263
1901
1627
1644
1771
1812
1270
1497
1707
1708
1396

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,323 @@
....#..#.................#..#..
#..#.#.#..#.###.#..#...#..#....
.#....#......#.#.#..##...#...#.
.............#.#..#........#.#.
............##.#..#...##.###...
.....#..#......#......##.......
........##........#...........#
..................#..#.........
......#..#...#..#......###..#..
.#....#...........#.....#.##...
..#..#.#........###..#....#...#
..#..##..#..#....#..#......#...
......#....................#...
.........#..#..................
..#.#.....#......#.#....#...#..
..#..........##.......##.##....
#.......#.##.....#...#....#....
####..............###.#....#...
....#........#.#..###..#...#..#
#.#......#...#.##....#.....#...
.......#......#.....#........#.
.##.........#...#.........#....
............#....#.#........#..
#..##..#....#...#.#....#....#..
.....#....##..#................
.#...........#....#..#.....#...
......#.#...#..###.............
#...#...........#..###.#..#..#.
...................#..#....#..#
....#...#...#.#.....#....#.##..
.......#.......#.#.........#...
#..#.......#...#..#.#......#...
..##...........#....#..#.......
.#...............#...##........
.....#..........#............#.
..#.......#.#.#...........#..#.
........#..#.#.#........#.#.##.
.###..............#.#..........
.#....###.....#......#....#....
............#.#......#..#....#.
.#.#.............#........##...
.....#..###....##.....#....#..#
.##....#...#.#.........#......#
....##.......#...............##
..........##.##.......#........
......#....##.........##.#.#.#.
..............#....#..#......#.
......##.........#.........#...
.#...##...##....##..#..#.....#.
.#......#.###.#....#...#......#
.##.......................#..#.
....#......#.##..........#.###.
.#.....##..........#.#.........
....#.#.........#...#..........
.#..##.#....##.......#.......#.
.........#.......#............#
###..........#.....##.#....#...
.......###.#....#........#...##
..#..#....#.......#.#..........
.#..#..........#......#...#....
.....###.#..#.....#...#..#.....
........#.#.#..........#.#..#..
........#...##.................
...#.............#.#..#......##
......#......##......#...#.#..#
.#..#...##..........#...##.....
..#.#....####..#...#....##....#
.#..##.........#..##......#....
#....#.#.........#.............
....###..............#....#....
....#..#..#...###..#.#..#.#....
....#.....#...........###..#...
....#.#.....#...#.....#.......#
..#.......#..................#.
#...................##.........
....#.#.#.#.#.....#.....#......
...............##..#..##.#...##
..#.....#.....##.........#..#..
...#...#.....#..##..##....#..##
..#.................#....#...#.
#....##...............##..#....
..#.....#.....##.........##...#
..#.###..............#...#.....
.......................#.......
#...#..#.....##...#...#........
..........#......#.###....#...#
..#.....#.##.#..#.#.......#....
#.##...#............#..........
#........#.#.#..#...#..#.....##
#............#.#...............
.#..#.......#.#.....#.#......##
.#.#....#........#..##.........
..#....#......#.#...##...#.....
##.....#......................#
...#.......#..##.....#........#
......##..#...............##...
.....#...#......##....#.#......
.#...#....#.#.#........#...#.#.
.......#...#...##...#..........
.##..#..##........##....###.#..
..##........#........##........
............#....#......#......
.......#...........#.......#...
#.#......##.#...#....#.#.....#.
..#.#.#......##........#....#..
#.#.####.#..#..........#.......
......................#.#......
...#.......#.....#......#..#.#.
...#....#....##..........#..##.
......#......#....#.........#..
.........#....#...#.#.........#
.....#...##.#.#.#......#.....#.
........#...#......#.#....#....
.....#.........#.............#.
.#...........#.#....##.......#.
.#..#......#....#....#....#....
#.......#.#.#.#..#.......#.....
..#...#...#......#.............
.....#.......#..#.........##..#
#..##...........#.#.........#..
#..#..........#....#......#...#
#...#............#....##..#.##.
....#.#..#....#.........##..##.
.........#..........#.......##.
#...#........................#.
....#....#..#...........##...#.
.....###.###.#....#.....#.....#
.#..###..#...##..........#.....
#..#.....#...#........#........
.#..##..#......#.....#......##.
#.....##........#.#..#....#.#..
.#....#...#..#...............#.
..........#.#........#.....#...
..#.#.....#....#........#.###..
...#..#...#.##.....#..........#
..#......##....................
.....#...#....#..#....#.......#
......#............#....#...#..
.#..#....#.....#........##.....
...#..#.......#...............#
##.#..#...............#.#..##..
..#.........#.####.####........
.........#...#.#........#..###.
..###.....#.........##........#
#..##.....##.#..........#....##
.#..#....###..#.....##..#......
#...#..#........#.............#
#.#....#........#.........#.###
.....#....#.###.......#........
...........#............#..#...
..........#.#..##......###....#
..##....#...........#....#....#
..#...##.#.......#.##.......#..
.......#......#..........#....#
.........#..#..............####
#.#...#...#......#...#..#...#.#
.#.#...#.....#.......#.#..##.#.
......##..##...#...............
....#....#...##.......#.#......
.............................#.
..##...#.......#......#.......#
.#.##.##....#......##.......#..
.......##..#....#.##.#.#.......
....#.............#......#..#..
...#.........#....#..#.....#.#.
......#......#......#.........#
........#..#.#.....#.....#...#.
.#.......#.........#...#.......
#.#.##.....#...#...............
..#.......##.....#............#
.................##.#..#.....##
........#.###....#.......##.#..
....#.#..#..#.......#.#....#..#
.#..#..#..#...##....#..#.....#.
...#..#...#..........#........#
...........##....#...##.#...###
.##..#.......##.....##....#....
...#.#..#..#..##..#.....##.....
.#.....#..........#...#........
.....#..#.#..#.................
..#.......#..#.....##.......#..
............##.##.....#...#....
#......#......................#
...#..........#...#...#..#.....
......##..............##.##....
................##......#.###..
.###...#..........#...........#
#....#...#.........##......#...
.............#...............#.
.###.....#......#...#.......#..
......##..#.#.#.....#........#.
..#.#..........#.#......##.....
.#.#...#.#.....#.#..#.....#....
.......#....#.#....##..........
#.........#........####.#......
...#..#.....#..............#.#.
...#..........................#
..##....#..#..........#....#...
..##.##.#.#.#......#..#........
...#..#.#.#..#........#.......#
.....#.....#..#...#........##..
..#..#...........#...##..##..#.
#.....#.....#..#..##........#..
...#..............#......#..#..
...#.#...........###...#.#.....
..........................#.#..
....#........#..#..........#.#.
.#..#..........#.#..........#..
....#.........#......#.#....#..
..#........#.................#.
...#......#............#.......
...#.#...#..##....#........#...
......##.#....#.#......#.......
........#..........#........#..
###..#.....#...#......#...###..
..##...#..###............#...#.
#.......#..#..#............##..
#........####......#...........
#..#..#...........#.......####.
......#..##................#...
.....#..##......#.#...#..#.....
......#.....##.....#.###.......
.#.....#.........#.......#.#..#
.##...........###...#....#...#.
.#....#..#....#.##...#.........
.................##............
......#......#.............#...
.........##.#........#....#...#
..##....#.......#....##.#......
.......#.#.#.....##..#.#.......
......#.#.#.#......#...#.......
....##...#.....#..#......#.....
..............#......#.##......
#.##..###........#.##........##
#..#.........#.#......#.#......
.#..###.......#................
..............#...#..##.#.#....
.....#..#........#...##.#...#..
.#...##.....#........#..###.#..
....#.....#...#........#.......
....#.##.....#....#............
#.#..#....#....#............#..
....#....#...#.#...#...######..
.##.........#..#.....#.....#...
..##...............#...........
........##...#........#..#.....
...#................###.##..##.
.#..#..#..#...#.............#..
#.....#..##.#....#.#......#..#.
...#...#...#.....#...#...#.....
..##.###..#..#...##...........#
.#.......##........#.#..#..#...
..#.......#.###................
..#...#........##...#..#......#
...#...#............#.#......#.
..#...#.....#.#.#.#........#...
.#........#......##....##...#..
...#..##....#.........#....#.#.
....#........##...............#
.###.....#...#..#.#.....#.....#
..#...#..................#...##
#..#....###....................
...........#...#...........#...
........#.....#................
#........#...........#........#
........#..#....#...#....#..#..
#.#....#......#.......##.......
.#.....##..#...#......#.#.#....
..#..##.#.....#...#.#......#.#.
.##....#...#....#......##......
.#..#..#...##.##..#.#..#.......
.....#.#...........#.#........#
.#...#....#..................#.
...........#...#.........#.....
.#..###........##......#..#...#
.............###..##.....#.#..#
.#..#..........#......#........
..#........#.#...#.......##.#..
....#...........##......#...#..
...........#....#.....#...#.#..
...#...........#.....#.#..#..#.
......#.......#................
##.......#.....#............#.#
.##.....#.#.#..................
..........#.....##..#.#.#......
.###.#.....##...#..#.#........#
#....#........##..#..#.........
.............#.........##..#...
......##.#...#.#.#....##.......
.#.......###.#.###..##........#
..##.....#..#.............#..#.
.#...#......#.#.............#..
..##.#...#.........##....#...#.
...........#......#.#..........
.....#..#...##.....#....#..#...
#...................##...#.....
..#.................#.....#....
..............#..#.#...###.....
.......#........#...#.....#....
.............#.......#...##..#.
.#...#..#...#..#.....#......#.#
....#..#..#...#...........#....
.....#..#......##.##....#..#...
...#......#..#.#...#.....#.....
.......##..#.#.......#..#....##
#.#..#....##.##.#.#..........#.
..........#..........#....##.#.
....#.................#...#..#.
...#.....#..#...#.#...#..#.....
....#.#..###....#.............#
#....#..#.#..........#..#..#...
...#..#......#...#...#...#...#.
##....#.......#..........#.....
#......#.........#...#.........
##...##.#....#....#..#..#.#....
....#..#.....#.##.#.......#.#..
..##....##....#...#..####...#.#
..##..........#.............#..
..#......#..............#......
...#......#..#.#...#.......#...
.#............#....#...##.##..#
..##..........#...........#..#.
..#..##..#....#..#.#..#..#..#..

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,757 @@
FBBBBBBLRR
FFFBFFFLLR
FFBBBBBRRL
BFFBFFBRLL
BFBFBBFLLR
FBFBBFBLLL
FBFBBBFRRR
FBFFBBBLRR
FBFBBBBRLL
FFFBBFBLLR
FBFBFFFRRL
FFBBBFFLLR
BFFFFFBRRR
FBFFFFFLLR
FFFBBFFRRL
FBBBBBBRRR
FBBFFBBRLR
FBFBFBBRLL
BFFBBFBLLR
FBFFFFBLLR
FFFBFFBRLL
BFBBBBBLRL
BFFBFBFLRR
FFBBFFBRLR
BFFFFBFLRR
BFFFFBBLRR
FBBFFFBLLL
FFBFBFBLRR
FBFBFBBRRL
FFBFBBBLRR
BFFBFFFRRL
BFBFBFBRRL
BFFBBBFRLR
BFBBFBFLLR
FBFBBBFLRL
FBFFBBBRLL
BFFFFBBLRL
BFBBBBBRRR
BFFBFFFLLL
BBFFFBFRRL
BFFBFBBRLL
FFBBBBFLRL
BFFFFFFRLL
BFFFBFBLRL
FFBBFBBLRL
BFBBBBBRLL
FBFFBBBLLL
BFBBFBFLLL
BFFBBBBRRL
FFFBFFBRLR
BFFBFFFRRR
FFBBBBFLLR
FBFBBBFRRL
BFBBFBBRLR
FBFBFFFRRR
BBFFFFBRLL
FBFFBFFRLL
BFBFBBBRRL
FFFBFBBLLL
FBBFBBFLLL
FFBBBBFRRR
FFFFBBBRRR
BFBFFBBRRL
FBBFFFFLRR
BFFBBFBRLL
FBFBBBBRLR
FFBBFBBRRR
FBBBBFFLRL
FFBFBFFRLL
BFFBBFFRRR
FBFBBBFLLR
BBFFBFFLRR
FBBFBFBLRR
FFFFBBBLRR
FBBFFBBLLR
FBBBFBFLRR
BFBBFFBLRL
FFBBFFFRLR
FBFFBFBRLR
FBFFFFFRLL
BFFFBFFRRL
BBFFFBBRRL
FFFBFFBLLL
FFBBFBBRLL
FBBFBBFRRR
FFFBFFFRLL
FFBFFFBRRL
BBFFFBFLRL
BFBFBBFLRL
FFFBFBFLLR
FFBBFFFRRR
BFFBBFBLRR
BFFBFFBLRL
FBBBFFBRRL
BFBBBFBRLR
BFFFBBBRRR
BBFFFBFRLR
FBFBFFBLLR
BFFFBFBLLL
FFBFFFBLRR
FFBBFFFRLL
BFFFBFFRRR
FBBFBFBRRR
BFBBBBFLLR
FBBFFBBRRL
BFFBFBBRRL
BFFBFBBLRL
BFFFBFBRRL
FFFBFBFRRL
FBFFFFBLRR
BFBBBFFRLL
FBBBFFFRLL
FBFFFFFLLL
BFBFFBBRRR
FBFBFFFLRL
FFFFBBFRLL
FBFFFBBLRR
BBFFFBFLLR
FBBBFFFLRL
FFBBFBFLRL
BFFFBBBLRR
BFFBBBFLRR
BBFFFFBRLR
FFBFBBFLRR
FFFBBBBRRL
BFBFFFFLLL
FBFBBFBLLR
FBBBBFFRRL
FFBFBBFRRL
FFFFBBFRRR
BFFFBBBRRL
BFBBFBFRRR
BBFFFBBLRR
BFBBBFBLRR
BFFBBBBLLL
BFBFFFBRLL
FBBBFBBRRL
FFBBBFBLLL
BFFBFBFLLL
BFBBFFBRRR
BBFFBFFLLR
BFBBBBFRRR
BFFFBBFLRR
BFFFFBBLLR
FFFBFFBLRL
BFBBFBFRRL
FFBBFBFLLL
BFFFFBFLLL
BFBFBBFRRL
BFFBFFFRLR
FBBBFFBRLL
BFBBBBFLLL
FBFFBFFRRR
BFFBFFBRRR
FBBBBBFRLL
FBBFBBBRRL
FBFBFFFRLR
FFFBFBBRLL
FFFBBFFRLR
BFBBFBBRRL
FFBBBBFLLL
BFFBFFBLLL
FBFBBFFRLL
FBBBFBFLLR
BBFFFFFRLL
FFBFBBBRRL
BFBFFFBRRR
FBBFFFFRLL
FBFBFBBLRL
FFBBFFFRRL
FBBBFFBLLL
FBBFFBBLRR
BFBFBBBRRR
BFBBBBBLRR
FBBFBFBRLR
FBBBBFBRRL
BFBFFBFRLL
FFBFBBBRLL
FFBFFFFRLL
FBFFBFFLLR
BFBBBBBLLR
FFBFFBFRLL
FBFFFBFLRL
BFFFFBFRRL
FFBBFBBLRR
BFBFFBFLRR
FBBBBFBLLL
BBFFFFFRRL
BFFBFFBRLR
BFFBBBBRRR
FFFBFFBLLR
BFFBFBBRRR
FFFBFFBLRR
FFBBBFBRLL
FFBFFFBRRR
FBFBBFBLRR
FBFFFFBLLL
FBFBFBBRRR
BFFBFFFLRL
BFBBBFFRLR
FBFBFBBLLR
FFFBBFBLRR
BFFBFFFLLR
BBFFFBBLLR
BFFFBBBLLR
BFBBBBBRLR
FBFFFBFRRR
BFBFBFFLRR
FBBBBBBRLL
FFFBFFFLRL
BBFFFBFRLL
BBFFBFFLRL
FBFFFBBLLL
BFFBBBFLLL
BFBBFBFRLR
BFBFBFBLRR
FBBFFBFRRR
FFFBFFBRRR
BFBBBBFLRL
FBBBFBBLLR
FFBBBBBRLR
FFFBBBFRLR
FBBFFBFLLL
FFFBFBBLRR
BFBFBBFLRR
BBFFFBBLLL
FBBBBBFLRR
BBFFFBFLLL
FBFBBFBRRR
FBFFBBFLLR
FFFBBFBRRR
BFBFBBFRLR
FBFBBFFLRL
FFBBBFBRRL
FFBFFBFRRR
BBFFFFFLLL
BFBBFFFRLR
FBFFFFBRRR
FBBFBFFRRL
FBBFBBFRLR
FFFBFFFLRR
FBBBFFFRRL
FFBBBBBLLR
BFBBBFBLLL
FBBBBBFLLL
FFBBFBFLRR
BBFFFFBRRL
FFBBBFFRRR
FBFBBFBRLL
FBBBBBBLRL
BFBFFFFRRL
FBBFBBBRLR
FBBFBBBLRR
FBFBFBFRRL
FBBFBFFLLL
FFFBFBFLRR
FBFBBFFRLR
BFFFBFFLLR
BFFBFBBRLR
FFBBBBBLRR
BFFFFFBLLR
BFFBBBBLLR
FBFBBFBLRL
BFFBFFFLRR
FFFBFBFRLR
BFFBBBBLRR
FFFBBFFLLR
FBFFFBBRRR
BFBBBFFRRL
FFBBBFBRRR
FBBBFBBLRL
BFBBFFFLLR
BFFFFFBRRL
BFFBBBBLRL
FBBBBBFLLR
FFFFBBFLRR
BFBBFBBLLL
FFFBBBFRLL
BFBFFFFRRR
BFFBBFBRRL
FBFFFBBRLL
BFFFFBBRRL
BFFBBFFLLL
FFFBFBFRRR
FBBBBBFLRL
FFBFFBBLRR
FFBBBFBLRR
FFBFFFBLLR
FBBFFBFRRL
BFFFFBBLLL
BFFFBFFRLR
FBBBFFFRRR
BFBFFBFRLR
FBFBFFBLLL
FBFBBBFRLL
FBBFBFBRRL
FFFBBFFRRR
FFFBFBFLRL
FBFBFFFRLL
BFFBBBFRRL
FBFFBFBLLR
BFFFFFFRRR
BFFBFBFRLR
FFBBFFBLRR
FBFFBFFLRR
FBBBFFBRRR
FFFBBBBLLL
FBBFBBBLLR
BFFFFBFLLR
BFFBBBBRLR
BFFBBBFRRR
FBBBFFFLLL
BFBFFFBRRL
FBFFBFBLRL
BFBBBFFLLL
FBBBFFBLRR
FBBFBFFRLL
BFBFFBBRLL
BFBFBFFLLR
FBFFFFFRLR
FFFBBBBRLR
FFFFBBBRLR
BFFFBFFLRL
FBBFFFBLLR
FFBFBBFLLR
FFBBFBBLLR
FBBBFBFLLL
FBFFBFBRLL
FBBFBFBLLR
FFBFBFFRLR
FFFFBBBRRL
BFBFFBFRRL
FBBBBFFRLL
BFFBFBFRRL
BFBBFFBRRL
BFFFBFBRLR
FFFBFFBRRL
FFBFFBFRLR
BFFFBBBRLL
BFBBBFBRLL
FBBFBFFLRR
FFBBFBFRLR
BFBFBFBRLR
FBFFFBBRLR
BFFFFFBLRL
FBBFFFFLLR
BFFBFFFRLL
FBFBBBBLRL
FBFBFBBLLL
FBBBBFBLRR
FBBFBFBLRL
BFFFFBFLRL
FBFFBFBLRR
FBFFBBFLLL
BBFFFFFLRL
BFBFFFFLRR
BFBFBFFRRR
BFBBFBBLRR
FFFBBBFLLR
BFFBBFFLLR
FBBFFFFRRL
FBFFBBBRLR
FBBFFBBLLL
FFFFBBBLLR
BFBFBFFLRL
FFBFFFFRRL
BFBFFFBRLR
BFBFFFBLRR
FBFFBBFRLR
FBBBBFFLRR
FBFBFBFLRR
FFBBBFFLRR
FFBFFFFRRR
BFFFBFFLLL
FBBBBBBLLR
BFBFFFBLLL
FBFBFBBLRR
BBFFBFFRLR
FBFFBFFRLR
FFBBFFBLLR
FBBBBFBRRR
FFFBBBFLLL
FFBFBBFRLR
FBBBFBFRRR
FBFBBFBRLR
FBFFFBFRRL
FFFBFBFRLL
FBBFFFBRLL
FBBBFFFLRR
FFBBFBFRRR
BFBBFBFLRR
BFBFFBBLRL
FFFFBBFLLR
BFFBBFFRLL
FFFBBBFRRL
BFBBBFBRRR
FFBFBBBLRL
BBFFFFBLRL
BFFFFFFLRR
FFBFFBBRLL
FBBBFBBRLR
BBFFFFFLLR
FBFBFBFRRR
FBBFFBBRRR
FBBFFFBRRL
BFFBFBBLLL
FFBBBBFRLL
FFBBFFBLRL
FFFBBFFLLL
FFFBBBBLRR
FFBFBBBRRR
FBBBBFBRLL
FBFFFFFLRR
BBFFFFBLLL
FBFBBFFLLR
BFFFBFBLRR
BBFFFFBRRR
FBBFBFFRLR
BFBFBFBRLL
FFBBBFFRLL
FBFFFBBLRL
FFFBBFFLRR
BFBFFBBLLL
BFBFBBBLLR
FBBBBBFRRL
FFFFBBFRLR
FBBFBFBRLL
FFBFFFFRLR
BFBBFFFRRR
FFBFBBFLRL
BFBFFFFLLR
BFFFBBFRRL
FBFFBFFLLL
FBBBFBFRRL
FBFBFBFLLR
FBBFBBBRLL
BFFFFFBRLL
FBFFBBFRLL
BFBBFFBRLL
BFFBFBBLLR
BFFFFFFLLR
FBBBBFBLRL
FBFBBBBLRR
FFFFBBBLLL
FBBBFFFRLR
FBBBFBFLRL
FFFBFFFRLR
BBFFFBBRLR
BFBFBBBLRR
FFBFFBBRRR
FFFBFBBRRR
FBBBBFFLLL
BFBBBBBLLL
FFBFFFFLRL
BFBFFBBLRR
FFBFBFBRLL
FBBFBBBLLL
FBBFBBFRRL
BBFFFBFLRR
FBFFFFBRLR
FBBBBBFRRR
FFFBBFFRLL
BFBBFBBLRL
FFBFFFBRLR
FBBFFFBRRR
FFFBBFBRRL
BFBBBFFRRR
FBFBFFBLRL
FFBFFBBRRL
BFBFFFFRLL
FBBBFBFRLL
FBFBFFBLRR
FFFBBBFRRR
FBFFBBBLRL
BFFFBBBLRL
BFBBFFFLRR
BBFFFBBLRL
FBFFBBFRRL
BFBBBFBLLR
BFFBFFBRRL
FFBBBFFLRL
FFBFBFBRLR
BFFBFBFLLR
BFFFFBBRLL
FFFFBBFLRL
BFFFBBBLLL
FBBFFFBLRL
BFFFFBFRLL
BFBBFBBLLR
FBBFBBFLRL
FBBFFBFLRL
FFFFBBFRRL
FBFFBBBLLR
FFBBBFFLLL
FFBFBFFLRR
FBFFBBFLRR
FFBFBBBLLL
BFFBBBFRLL
FBFFFBFLLR
BFBBBBFLRR
FBFBFFFLLL
FFFBFBBLLR
FFFBBFFLRL
FBBBFBBLRR
FBBBFBBRLL
FFBBBFFRLR
BFBFFFFRLR
FBBFFBBLRL
FBFBFFBRRL
BFBBBFFLRL
FFBBBBBLRL
FBBBBFFRLR
FFBBFFFLLL
FBFFFFFLRL
FFFBFFFRRL
BFFFBBFRLR
FFFBBFBLRL
FBBFBBBRRR
FFFBBFBLLL
BFFFFFFLLL
BFBFBBFRLL
BFFFBFFRLL
FFBBBBFLRR
FFFBBBBRLL
FFBFBBFLLL
BFBBFFBLRR
FBFFFBFLRR
BFBBFFFLRL
FFBBFBBRLR
BFBFFBFRRR
FBBFFFBLRR
BFFFFBFRLR
FBFFFBBLLR
FBFBFFFLLR
FBBBBFFRRR
FBBFFFFLLL
FFBFFBBLRL
FFBBBBBRLL
FFBFBBBLLR
FBFFBFFRRL
FFBFFBBLLR
BFFFBBFLLL
FFBBFFBRLL
FFBFFBFLRR
FFBFFBBLLL
BFBBBFFLLR
FBFBFBFLRL
FFBBBBFRLR
BFBBFFBLLR
BFFFFFBRLR
FBFFFFBRLL
FBFBFFBRLR
BFFBBFBLLL
BBFFBFFRLL
BBFFFFFLRR
BFFFFBFRRR
BFBFBFBLLR
BFFFFFFLRL
FFBBFBBLLL
FFFBBBFLRR
FBBFFBFRLR
BBFFFBBRLL
FBBFBFFLLR
FBBFFBFLRR
BFFFBFBRLL
BFBFBFFLLL
FBFFBBBRRL
FBBBFBFRLR
FFBFFBFRRL
BBFFBFFRRL
FBBFFFBRLR
FFFFBBBRLL
BFBBFFFRRL
BFBBBBBRRL
BFBBFFFLLL
BFFBBBFLLR
FBFFFFFRRR
FBFBBFFRRL
FBBBFBBRRR
FBFBBBBLLL
BFFFFBBRLR
FFFBFBBRLR
BFFBFFBLRR
FBBFFFFRLR
FBFFBBFRRR
FFFBFBFLLL
BBFFFFBLRR
FBFBBBFLRR
BFBBBBFRRL
FFBBFFBRRL
BFFBBFBRRR
FFBFBBFRRR
FBFFFBBRRL
FBFBBFFLLL
BFFBFFBLLR
FBBFBFFRRR
FFFBBBFLRL
BFFBBBFLRL
FBFFFBFRLR
BFFFFFFRRL
FBBBFFBLLR
FBBBBBFRLR
BFBFFFBLLR
FFBBFBBRRL
BFBBFBFLRL
FBBBBBBRLR
BFFBFBBLRR
FBFFBBFLRL
FBBBFFBLRL
FFBBFBFRLL
BFBBBFBRRL
FBFBFFBRRR
FFBFBFFLLR
FFBFFBFLLL
FFFBBBBRRR
FBFFBFBRRL
FFBFFFFLRR
FFFFBBBLRL
FFBBBBBRRR
FFBBFFBRRR
FFBFBFBRRL
FFFBBFBRLR
BFBBFFBRLR
BFBBFBBRLL
FFBFFFBLLL
FFBBFFBLLL
FBBFFFFLRL
FFFBFFFLLL
BFBBFBFRLL
BBFFFBFRRR
FFFBBFBRLL
BFBBFFBLLL
FBFBFBBRLR
BBFFFBBRRR
FFFBBBBLRL
FFBFBFFRRL
FBBBBFBLLR
FBBFBBBLRL
BFBFBBBLLL
FBBFFBFLLR
BFBFBBBLRL
FFFBFFFRRR
FFBFFBFLRL
FBFBFBFRLL
FBFBBBFRLR
FBBBFFFLLR
FFBFBFFLRL
BFFBFBFRRR
FBBFBFBLLL
BFBBBFFLRR
FFFBFBBLRL
FBFBFBFLLL
FFBBBBBLLL
FBBFBFFLRL
FFBBFFFLRL
FBFBBBBRRR
BBFFFFBLLR
FFFBBBBLLR
BFFFBFBRRR
FBFFFFBLRL
FBFFFBFRLL
BBFFFFFRRR
FFBFFFFLLR
BBFFBFFLLL
FBFFBBBRRR
BFBBBBFRLR
BBFFFFFRLR
FBFBBFBRRL
FBFFFBFLLL
FBFBFFFLRR
FFBFFFBLRL
BFFFBBFLLR
FBFBFFBRLL
FFBBBFFRRL
FFBBBFBLRL
BFBFBBFLLL
BFBFBFBLRL
FBFBBBBLLR
FBBBBFFLLR
FFBBFBFLLR
BFBFBFFRLL
FFBBFBFRRL
FBBBFBBLLL
FFBBFFFLRR
FBFFBFBRRR
BFFFFFFRLR
BFBFBBFRRR
FBBBBBBRRL
FFBFFBFLLR
FFBFBBFRLL
FFBFBFFLLL
BFFFFFBLLL
BFFFBFBLLR
FFBBBFBLLR
FBBFFBFRLL
FBFBBBFLLL
FBFFFFFRRL
BFFBBFFRRL
BFBFFBFLLR
BFBBFBBRRR
BFFBBFFLRR
FBBFBBFRLL
FBBBBFBRLR
FFBFBBBRLR
FFFBFBBRRL
BFBBBBFRLL
FBFBBFFRRR
BFFFBBFRLL
FBFFBFBLLL
FBBFBBFLRR
BFBFFBFLRL
BFBFBFFRLR
BFBBBFBLRL
FBFFFFBRRL
FBBFFFFRRR
BFBFBFBLLL
BFBFBBBRLR
FBBFFBBRLL
BFBFFFFLRL
FFBFFFFLLL
FBFBFBFRLR
BFFBFBFLRL
FBFFBFFLRL
BFFFFFBLRR
FFBBFFFLLR
FFBFBFBLRL
BFBFFBFLLL
BFFBBFBRLR
FFBFFFBRLL
BFBBFFFRLL
BFFFFBBRRR
BFFBBFFLRL
FBFBBBBRRL
BFBFFBBLLR
FFBFBFBLLR
BFBFFBBRLR
BFBFBFFRRL
FBBFBBFLLR
BFBFBBBRLL
FBBBBBBLLL
BFFBBFFRLR
BFFFBBBRLR
FBFBBFFLRR
FBBBFFBRLR
BFBFFFBLRL
BFFFBFFLRR
FFBFFBBRLR
FFBFBFBLLL
BFFBBFBLRL
BFBFBFBRRR
FFBFBFBRRR
FFBBBBFRRL
FFBBBFBRLR
BFFBFBFRLL
BFFFBBFRRR
FFBFBFFRRR
BFFBBBBRLL

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,594 @@
wavy turquoise bags contain no other bags.
vibrant beige bags contain 4 drab lime bags, 1 muted violet bag, 5 drab plum bags, 5 shiny silver bags.
plaid green bags contain 2 pale olive bags, 1 dark chartreuse bag, 1 vibrant olive bag, 1 pale bronze bag.
plaid fuchsia bags contain 5 dull teal bags, 4 dark beige bags, 4 shiny teal bags, 5 vibrant orange bags.
vibrant coral bags contain 1 dotted blue bag.
drab tan bags contain 5 drab maroon bags, 5 bright silver bags, 2 dim tan bags.
light gray bags contain 3 dotted crimson bags, 3 dull chartreuse bags, 1 light maroon bag.
mirrored tomato bags contain 5 clear orange bags, 2 striped violet bags.
pale brown bags contain 1 faded fuchsia bag, 2 wavy orange bags, 1 mirrored coral bag, 5 dotted brown bags.
muted maroon bags contain 5 drab gold bags, 2 vibrant aqua bags, 5 bright crimson bags.
light purple bags contain 4 dim teal bags, 3 vibrant bronze bags, 2 dark chartreuse bags, 1 shiny green bag.
muted white bags contain 3 wavy lime bags, 5 muted lavender bags, 1 pale salmon bag, 1 dotted red bag.
plaid yellow bags contain 2 plaid gold bags, 2 faded lavender bags, 2 faded fuchsia bags, 3 faded gold bags.
plaid white bags contain 1 dull cyan bag, 4 pale cyan bags, 1 clear red bag, 5 vibrant orange bags.
wavy teal bags contain 5 wavy violet bags, 5 shiny silver bags.
pale crimson bags contain 1 wavy white bag, 5 clear tomato bags, 2 dark plum bags, 3 bright turquoise bags.
posh green bags contain 2 muted black bags, 3 light magenta bags.
striped maroon bags contain 1 bright green bag, 4 dark coral bags.
pale red bags contain 5 faded turquoise bags, 4 plaid crimson bags, 5 dark aqua bags.
vibrant chartreuse bags contain 2 pale red bags.
faded fuchsia bags contain no other bags.
pale olive bags contain 3 striped blue bags, 5 faded magenta bags, 3 light white bags.
striped tomato bags contain 4 faded plum bags.
shiny cyan bags contain 1 clear tomato bag, 4 clear magenta bags, 3 plaid teal bags, 5 dotted indigo bags.
plaid silver bags contain 3 dotted beige bags.
posh teal bags contain 3 faded black bags, 2 vibrant lavender bags, 5 light lavender bags, 5 faded lime bags.
clear gray bags contain 5 pale black bags, 2 dull salmon bags.
bright white bags contain 2 shiny olive bags, 5 dim brown bags, 1 dull crimson bag.
striped gold bags contain 3 mirrored yellow bags, 1 posh brown bag, 5 clear cyan bags, 3 striped tan bags.
light black bags contain 2 light lavender bags, 2 dotted bronze bags.
vibrant orange bags contain 3 posh plum bags, 5 light tan bags, 5 dim gold bags, 4 vibrant aqua bags.
dark chartreuse bags contain 3 striped purple bags, 2 dull beige bags, 5 wavy brown bags.
mirrored magenta bags contain 4 drab purple bags, 4 dotted brown bags, 2 light fuchsia bags.
striped magenta bags contain 1 drab gray bag, 1 wavy yellow bag, 5 drab plum bags.
dotted teal bags contain 4 pale indigo bags.
plaid red bags contain 4 clear fuchsia bags, 2 vibrant brown bags.
dotted green bags contain 2 striped teal bags, 3 muted bronze bags, 4 light red bags.
vibrant purple bags contain 2 drab plum bags, 4 dim beige bags, 4 drab aqua bags.
light indigo bags contain 1 dotted plum bag.
wavy green bags contain 1 shiny aqua bag, 2 dark lavender bags.
faded gray bags contain 2 plaid green bags.
dull purple bags contain 4 dull salmon bags, 1 plaid chartreuse bag, 1 dull tan bag, 4 pale green bags.
posh yellow bags contain 2 dim teal bags.
pale orange bags contain 4 mirrored red bags, 2 dotted chartreuse bags, 2 light yellow bags, 3 posh red bags.
dark tomato bags contain 1 light magenta bag, 4 light black bags, 2 vibrant aqua bags.
light cyan bags contain 1 shiny red bag, 2 plaid green bags, 4 clear cyan bags, 5 wavy tomato bags.
pale lavender bags contain 2 pale gray bags, 3 dotted violet bags, 2 striped lavender bags, 5 drab magenta bags.
dim coral bags contain 4 bright black bags, 1 shiny tan bag, 1 faded chartreuse bag, 1 bright silver bag.
muted purple bags contain 2 wavy yellow bags.
pale chartreuse bags contain 3 dotted red bags, 4 striped salmon bags, 4 pale brown bags, 2 dull yellow bags.
light red bags contain 3 bright crimson bags.
bright green bags contain 2 plaid fuchsia bags, 5 light lavender bags, 3 dotted cyan bags.
plaid purple bags contain 4 wavy tan bags, 5 plaid teal bags, 5 dull teal bags, 1 shiny gold bag.
vibrant gray bags contain 1 dull beige bag.
dotted orange bags contain 2 light green bags, 5 dotted brown bags, 4 pale blue bags.
dull black bags contain 5 pale silver bags, 4 pale lavender bags.
dull blue bags contain 1 striped turquoise bag, 2 dotted red bags, 5 dark white bags.
clear turquoise bags contain 3 dim beige bags, 5 faded brown bags.
pale magenta bags contain 1 dark violet bag, 1 dark yellow bag, 2 wavy aqua bags, 5 light silver bags.
bright teal bags contain 1 dark beige bag, 1 pale gold bag, 1 dim magenta bag.
pale plum bags contain 3 vibrant yellow bags, 1 dotted beige bag.
dull lime bags contain 1 faded coral bag, 4 plaid gold bags, 3 drab white bags.
vibrant olive bags contain 1 plaid teal bag, 1 faded tan bag.
muted magenta bags contain 5 clear gold bags.
dull olive bags contain 4 clear cyan bags, 1 dotted tan bag.
dim orange bags contain 3 drab lime bags, 1 drab plum bag, 2 vibrant tomato bags, 1 plaid blue bag.
wavy crimson bags contain 2 plaid gold bags, 3 light olive bags, 4 vibrant fuchsia bags.
clear tan bags contain 3 dotted beige bags, 2 dark purple bags.
plaid bronze bags contain 1 mirrored violet bag.
muted brown bags contain 4 dotted indigo bags, 5 dull crimson bags.
dull fuchsia bags contain 2 dotted gold bags, 2 striped violet bags, 1 clear lime bag, 3 shiny fuchsia bags.
mirrored gold bags contain 2 mirrored purple bags, 4 plaid aqua bags.
vibrant turquoise bags contain 1 light maroon bag, 3 dim teal bags, 1 dull brown bag.
shiny green bags contain 2 plaid orange bags.
dark crimson bags contain 1 striped purple bag, 4 vibrant salmon bags.
bright gray bags contain 4 plaid blue bags, 1 faded lime bag, 4 pale salmon bags, 3 bright bronze bags.
wavy salmon bags contain 1 wavy coral bag, 3 bright blue bags.
faded blue bags contain 3 muted fuchsia bags, 1 plaid lavender bag, 3 posh brown bags.
posh tomato bags contain 4 dim gold bags, 2 shiny gold bags.
striped yellow bags contain 3 vibrant turquoise bags, 3 dim salmon bags, 4 vibrant yellow bags, 2 faded beige bags.
light beige bags contain 5 striped purple bags, 3 muted gold bags.
wavy indigo bags contain 1 muted chartreuse bag, 2 wavy purple bags, 2 mirrored coral bags, 4 muted teal bags.
striped tan bags contain 4 light fuchsia bags, 2 dim chartreuse bags, 3 vibrant black bags, 1 muted black bag.
pale fuchsia bags contain 5 vibrant aqua bags, 5 drab purple bags, 5 shiny olive bags, 5 drab indigo bags.
pale cyan bags contain 5 dull teal bags.
dull chartreuse bags contain 5 wavy brown bags.
bright coral bags contain 3 clear orange bags, 3 shiny brown bags, 4 pale teal bags.
light magenta bags contain 3 light white bags, 1 clear indigo bag, 3 vibrant salmon bags, 3 dark crimson bags.
dull bronze bags contain 5 dotted gold bags, 4 dark olive bags, 3 vibrant magenta bags.
light lime bags contain 4 vibrant cyan bags.
muted aqua bags contain 3 dotted red bags, 2 wavy blue bags, 3 vibrant orange bags.
light violet bags contain 3 light green bags.
dotted red bags contain 1 muted teal bag, 4 striped tan bags, 3 wavy teal bags.
pale purple bags contain 4 dotted cyan bags, 1 dim magenta bag.
dim beige bags contain 5 dotted yellow bags, 4 faded magenta bags, 1 muted beige bag, 2 pale bronze bags.
light bronze bags contain 5 faded bronze bags, 2 drab bronze bags, 5 dark gold bags, 2 light purple bags.
wavy violet bags contain 5 light white bags, 3 light tan bags.
vibrant aqua bags contain 3 wavy turquoise bags, 4 dull beige bags.
pale bronze bags contain 5 light lavender bags, 4 dull beige bags, 3 bright crimson bags.
bright salmon bags contain 5 mirrored bronze bags, 5 dull orange bags, 2 shiny salmon bags.
muted blue bags contain 3 shiny yellow bags, 5 light yellow bags, 5 vibrant gold bags, 2 dotted coral bags.
dotted silver bags contain 1 plaid fuchsia bag, 5 light beige bags, 4 drab lime bags.
mirrored black bags contain 2 dull salmon bags.
bright black bags contain 4 faded magenta bags.
bright beige bags contain 2 mirrored salmon bags.
bright indigo bags contain 4 clear brown bags, 3 bright green bags.
mirrored lavender bags contain 3 shiny tan bags, 4 dark purple bags, 2 striped tan bags.
light aqua bags contain 2 light magenta bags, 5 vibrant tan bags, 5 drab plum bags, 1 plaid tomato bag.
mirrored maroon bags contain 4 vibrant tomato bags.
posh turquoise bags contain 1 striped white bag, 3 dim lavender bags, 3 posh teal bags, 2 mirrored salmon bags.
shiny gray bags contain 1 vibrant beige bag, 3 light tan bags, 4 wavy teal bags.
wavy black bags contain 4 dark tomato bags, 3 dim gold bags, 4 dark beige bags.
drab silver bags contain 2 light green bags, 3 light gold bags, 4 drab plum bags, 1 dotted yellow bag.
pale violet bags contain 1 dull beige bag, 2 shiny teal bags, 1 light lavender bag, 3 mirrored red bags.
dark blue bags contain 1 dotted indigo bag, 1 clear tomato bag.
dull teal bags contain 5 vibrant salmon bags, 3 vibrant aqua bags, 5 wavy tan bags, 5 striped purple bags.
faded tomato bags contain 2 shiny chartreuse bags, 4 clear orange bags, 5 bright orange bags.
mirrored red bags contain 5 muted beige bags, 2 faded white bags.
mirrored lime bags contain 4 posh crimson bags, 5 pale turquoise bags, 3 wavy blue bags.
mirrored crimson bags contain 1 faded white bag, 2 dark crimson bags, 3 striped cyan bags.
light teal bags contain 3 clear indigo bags, 1 wavy tan bag, 4 dim gold bags.
wavy chartreuse bags contain 5 wavy plum bags, 2 shiny salmon bags, 3 clear olive bags.
shiny black bags contain 2 drab aqua bags, 4 dull brown bags, 5 wavy silver bags, 1 vibrant brown bag.
bright violet bags contain 2 striped magenta bags, 4 vibrant gray bags.
muted tomato bags contain 1 drab turquoise bag.
muted teal bags contain 3 dotted blue bags.
dim cyan bags contain 3 dotted blue bags, 1 vibrant coral bag.
striped fuchsia bags contain 1 shiny gold bag, 5 dark beige bags, 5 mirrored indigo bags.
clear bronze bags contain 3 striped orange bags, 2 vibrant tomato bags.
vibrant lavender bags contain 2 muted beige bags, 4 shiny teal bags, 4 dull beige bags.
light olive bags contain 5 shiny yellow bags, 1 vibrant cyan bag.
shiny fuchsia bags contain 4 dim brown bags, 2 dull chartreuse bags.
plaid turquoise bags contain 3 bright green bags, 4 light fuchsia bags, 2 light lavender bags.
shiny brown bags contain 5 mirrored plum bags.
pale white bags contain 4 dull magenta bags, 1 posh purple bag, 4 pale olive bags, 4 wavy olive bags.
pale yellow bags contain 1 bright blue bag.
dark salmon bags contain 3 wavy turquoise bags, 1 dotted plum bag, 3 faded white bags, 5 dim tan bags.
shiny crimson bags contain 5 faded coral bags.
pale green bags contain 2 posh beige bags, 5 dark silver bags.
dim gray bags contain 4 dull cyan bags, 2 muted salmon bags, 4 mirrored tan bags, 1 bright violet bag.
dim blue bags contain 4 light orange bags, 4 wavy beige bags.
mirrored cyan bags contain 3 pale cyan bags.
dark aqua bags contain 2 striped blue bags, 5 light white bags, 4 drab gray bags.
wavy tan bags contain no other bags.
light tan bags contain 1 clear aqua bag.
light silver bags contain 1 light green bag, 2 pale bronze bags, 1 bright crimson bag, 1 vibrant aqua bag.
plaid tan bags contain 5 posh silver bags, 1 shiny beige bag.
shiny white bags contain 1 pale olive bag.
dotted brown bags contain 1 bright silver bag, 5 light tan bags, 4 light coral bags.
shiny bronze bags contain 2 vibrant plum bags, 2 wavy teal bags, 1 bright red bag, 5 clear tomato bags.
striped violet bags contain 5 vibrant gray bags, 3 dark maroon bags, 4 dotted fuchsia bags, 4 plaid purple bags.
dull plum bags contain 4 dark gray bags, 1 wavy aqua bag, 2 muted aqua bags, 5 striped crimson bags.
posh blue bags contain 1 dotted bronze bag, 5 muted indigo bags, 2 light tan bags.
posh tan bags contain 4 shiny gold bags, 3 drab maroon bags.
striped aqua bags contain 4 muted bronze bags, 5 bright blue bags, 1 wavy tan bag.
shiny silver bags contain 1 light green bag.
dark white bags contain 4 drab purple bags.
dull green bags contain 5 wavy bronze bags, 5 faded white bags.
clear chartreuse bags contain 3 dark gray bags.
posh coral bags contain 2 shiny lime bags, 4 light blue bags, 3 muted bronze bags.
faded magenta bags contain 1 dull maroon bag, 4 shiny teal bags, 1 plaid teal bag.
drab brown bags contain 1 drab violet bag.
pale salmon bags contain 4 plaid gray bags, 2 wavy violet bags.
mirrored aqua bags contain 1 faded turquoise bag, 5 dull aqua bags.
striped gray bags contain 5 dark maroon bags, 3 shiny plum bags.
mirrored salmon bags contain 4 clear cyan bags, 2 vibrant olive bags, 2 striped silver bags, 3 muted lavender bags.
wavy purple bags contain 1 shiny beige bag.
plaid indigo bags contain 1 plaid plum bag.
plaid gray bags contain 5 pale blue bags, 3 shiny gold bags.
bright yellow bags contain 2 drab bronze bags, 3 drab teal bags.
drab red bags contain 4 drab indigo bags, 1 mirrored blue bag, 2 dull aqua bags, 4 light magenta bags.
dull white bags contain 2 muted black bags, 1 dim beige bag, 1 dark beige bag.
clear silver bags contain 5 muted bronze bags, 1 muted tan bag, 3 light aqua bags, 1 wavy fuchsia bag.
dark black bags contain 2 pale fuchsia bags, 5 pale brown bags, 5 drab black bags.
mirrored silver bags contain 4 drab plum bags, 3 shiny white bags, 5 muted crimson bags, 5 dull aqua bags.
dim tomato bags contain 3 drab red bags, 1 drab lime bag, 4 striped gray bags.
faded bronze bags contain 5 clear indigo bags, 2 dotted blue bags.
striped crimson bags contain 1 plaid tomato bag, 2 dull yellow bags, 3 plaid purple bags.
wavy olive bags contain 4 mirrored red bags, 4 drab indigo bags.
dotted turquoise bags contain 2 mirrored lavender bags, 4 light maroon bags, 2 pale teal bags, 1 mirrored crimson bag.
muted violet bags contain 5 shiny olive bags.
bright orange bags contain 4 pale tan bags, 1 striped fuchsia bag, 5 shiny olive bags.
striped turquoise bags contain 1 posh salmon bag, 5 shiny indigo bags, 4 wavy violet bags.
dull indigo bags contain 3 plaid plum bags, 4 faded plum bags, 3 dull violet bags.
posh black bags contain 4 clear brown bags, 4 vibrant cyan bags, 1 light white bag.
shiny orange bags contain 5 striped purple bags, 3 muted beige bags.
striped plum bags contain 5 dull salmon bags, 3 dull orange bags, 1 clear lime bag, 3 mirrored indigo bags.
clear white bags contain 4 wavy crimson bags, 3 plaid magenta bags.
pale tan bags contain 5 muted indigo bags.
dark red bags contain 3 bright magenta bags, 1 muted salmon bag, 4 vibrant gray bags, 5 clear green bags.
dark yellow bags contain 3 dim teal bags.
clear aqua bags contain no other bags.
vibrant white bags contain 2 drab yellow bags, 4 vibrant aqua bags, 2 plaid maroon bags.
posh lime bags contain 5 vibrant black bags.
clear teal bags contain 1 shiny olive bag, 5 bright aqua bags, 4 bright violet bags.
dotted indigo bags contain 2 muted fuchsia bags, 3 mirrored gray bags.
posh olive bags contain 5 clear maroon bags, 2 dim teal bags, 2 drab plum bags, 4 shiny olive bags.
dark coral bags contain 4 clear red bags.
dark olive bags contain 4 vibrant black bags.
faded olive bags contain 2 bright gray bags, 5 dull white bags.
dotted purple bags contain 1 faded brown bag, 5 dark purple bags.
faded plum bags contain 2 pale brown bags, 4 dark aqua bags.
bright plum bags contain 2 vibrant brown bags, 1 bright black bag, 1 dotted gold bag.
faded lavender bags contain 4 clear violet bags, 4 striped purple bags.
faded silver bags contain 4 dotted blue bags, 2 light purple bags, 1 bright chartreuse bag, 3 striped white bags.
bright cyan bags contain 5 dotted lime bags, 5 shiny gray bags, 1 faded orange bag, 5 clear indigo bags.
plaid tomato bags contain 1 clear violet bag, 3 muted beige bags.
wavy aqua bags contain 1 light tan bag.
dotted gold bags contain 5 mirrored indigo bags, 5 dull tan bags.
faded teal bags contain 5 plaid black bags, 2 clear turquoise bags.
striped white bags contain 2 dull aqua bags, 1 mirrored violet bag, 4 vibrant salmon bags.
mirrored violet bags contain 2 vibrant salmon bags, 1 clear brown bag.
drab magenta bags contain 3 muted lime bags, 2 bright orange bags.
pale teal bags contain 3 light black bags, 4 dim black bags, 2 muted gray bags.
dark teal bags contain 5 dark tomato bags, 4 dull teal bags, 5 striped white bags, 5 plaid aqua bags.
dim purple bags contain 5 wavy magenta bags, 2 muted fuchsia bags, 5 mirrored bronze bags.
clear violet bags contain 5 wavy turquoise bags, 5 light black bags, 1 mirrored indigo bag, 2 faded white bags.
dim indigo bags contain 3 dull teal bags.
dotted olive bags contain 4 dark red bags, 2 mirrored beige bags.
posh aqua bags contain 1 posh blue bag, 4 dotted black bags, 4 pale tomato bags.
clear orange bags contain 1 striped magenta bag, 3 wavy aqua bags.
plaid cyan bags contain 5 vibrant lavender bags, 2 light gold bags, 2 wavy orange bags, 4 bright turquoise bags.
mirrored green bags contain 4 plaid fuchsia bags.
dark silver bags contain 3 light coral bags.
wavy silver bags contain 5 plaid yellow bags, 5 pale orange bags.
plaid crimson bags contain 4 vibrant salmon bags, 4 vibrant blue bags, 1 light teal bag, 3 bright crimson bags.
mirrored bronze bags contain 1 dark coral bag, 2 clear orange bags, 4 plaid orange bags, 2 vibrant gray bags.
faded aqua bags contain 5 light white bags, 3 drab gray bags, 1 plaid beige bag.
drab yellow bags contain 1 dotted black bag, 2 dim silver bags.
dark beige bags contain 4 wavy tan bags, 5 light lavender bags, 5 dotted bronze bags.
clear green bags contain 5 shiny purple bags, 5 light teal bags, 5 pale bronze bags.
dotted lavender bags contain 4 wavy orange bags, 4 dull chartreuse bags.
bright chartreuse bags contain 2 dotted cyan bags, 3 pale olive bags, 4 vibrant salmon bags.
faded red bags contain 3 dull cyan bags, 3 drab indigo bags, 5 light green bags, 4 dark lime bags.
plaid brown bags contain 2 dotted salmon bags, 3 striped silver bags, 1 light blue bag.
dull beige bags contain no other bags.
dim violet bags contain 3 striped lavender bags, 5 dotted coral bags, 1 clear blue bag.
vibrant red bags contain 1 dark coral bag, 3 light gold bags.
faded violet bags contain 3 pale gold bags.
muted salmon bags contain 3 wavy turquoise bags.
vibrant gold bags contain 2 shiny teal bags.
dull coral bags contain 3 posh gold bags, 4 wavy olive bags.
mirrored fuchsia bags contain 5 wavy lime bags.
dotted plum bags contain 3 bright bronze bags, 3 light coral bags, 5 mirrored orange bags, 4 plaid gray bags.
dim fuchsia bags contain 4 light indigo bags, 5 faded red bags, 5 plaid orange bags.
dull brown bags contain 2 dim gold bags.
faded indigo bags contain 3 wavy olive bags, 1 shiny green bag.
pale coral bags contain 5 faded crimson bags.
light orange bags contain 3 bright gold bags, 1 striped magenta bag, 4 plaid lavender bags, 5 light green bags.
clear salmon bags contain 3 dim tan bags, 1 light lavender bag.
vibrant indigo bags contain 1 dark beige bag, 2 posh purple bags.
clear cyan bags contain 5 posh brown bags.
dull red bags contain 3 drab gold bags, 3 dark aqua bags, 5 dim maroon bags.
dim red bags contain 5 faded black bags, 2 shiny lime bags.
dark indigo bags contain 5 dull green bags, 2 striped white bags, 3 dotted indigo bags.
pale tomato bags contain 4 vibrant gold bags.
dim turquoise bags contain 4 plaid tomato bags, 2 plaid gray bags, 4 shiny violet bags.
dotted yellow bags contain 5 dotted plum bags, 3 muted beige bags, 4 light fuchsia bags, 1 wavy olive bag.
dim gold bags contain 3 muted beige bags.
mirrored orange bags contain 5 drab maroon bags, 4 dull teal bags, 1 faded tan bag, 2 dark aqua bags.
light chartreuse bags contain 4 vibrant gold bags, 5 dark silver bags, 3 pale purple bags.
posh silver bags contain 5 dotted silver bags, 4 dark chartreuse bags, 1 striped magenta bag.
vibrant black bags contain 5 muted red bags, 1 pale purple bag, 2 clear indigo bags, 4 faded magenta bags.
faded maroon bags contain 2 clear cyan bags, 4 wavy orange bags, 2 shiny blue bags.
bright lavender bags contain 5 dull chartreuse bags.
drab black bags contain 1 posh plum bag, 5 mirrored maroon bags, 3 dark yellow bags.
drab gray bags contain 4 clear violet bags, 3 mirrored red bags, 1 light silver bag, 1 wavy turquoise bag.
faded turquoise bags contain 2 light tan bags, 5 faded coral bags.
dark purple bags contain 5 pale cyan bags.
muted beige bags contain no other bags.
dull maroon bags contain 2 wavy turquoise bags, 5 light lavender bags, 5 muted beige bags.
bright tomato bags contain 3 plaid blue bags.
dim crimson bags contain 3 drab turquoise bags, 2 faded crimson bags, 2 plaid chartreuse bags.
clear magenta bags contain 3 light green bags, 5 dotted red bags, 1 mirrored indigo bag, 1 dim brown bag.
dotted aqua bags contain 5 clear crimson bags, 1 wavy orange bag.
dark fuchsia bags contain 1 dull maroon bag.
faded salmon bags contain 2 wavy yellow bags, 3 faded plum bags.
muted chartreuse bags contain 5 light gold bags, 1 bright bronze bag, 5 light beige bags, 4 light black bags.
muted lavender bags contain 3 mirrored coral bags.
drab fuchsia bags contain 3 plaid brown bags.
dim plum bags contain 4 vibrant brown bags, 3 plaid beige bags, 3 dark crimson bags, 4 bright teal bags.
shiny magenta bags contain 1 muted black bag.
wavy magenta bags contain 2 faded lavender bags, 1 bright gray bag, 3 pale olive bags.
mirrored plum bags contain 5 muted maroon bags.
wavy plum bags contain 5 dark crimson bags.
striped lavender bags contain 4 vibrant yellow bags, 2 vibrant lavender bags.
faded beige bags contain 4 pale indigo bags, 5 vibrant tomato bags.
shiny gold bags contain 4 drab gray bags, 4 light coral bags.
dotted beige bags contain 5 drab maroon bags, 1 shiny gold bag, 3 light lavender bags.
dull yellow bags contain 3 pale bronze bags, 1 bright silver bag.
muted green bags contain 3 faded red bags, 2 plaid green bags, 3 plaid black bags, 1 light yellow bag.
vibrant silver bags contain 5 striped purple bags, 3 shiny olive bags, 4 vibrant lavender bags.
dim green bags contain 4 vibrant gold bags, 5 muted maroon bags, 1 plaid aqua bag, 2 posh silver bags.
faded lime bags contain 2 shiny white bags.
bright bronze bags contain 5 muted gold bags, 3 light black bags.
shiny yellow bags contain 5 light green bags, 5 wavy brown bags.
dark cyan bags contain 5 light teal bags, 1 posh yellow bag, 3 shiny aqua bags.
striped blue bags contain 1 muted gold bag, 4 dull maroon bags, 3 clear red bags, 5 faded fuchsia bags.
dim tan bags contain 1 bright tan bag.
shiny red bags contain 3 plaid turquoise bags, 1 dotted cyan bag, 1 pale fuchsia bag.
vibrant brown bags contain 5 dim magenta bags, 4 drab white bags.
dull turquoise bags contain 2 bright orange bags, 4 bright gray bags, 3 dim chartreuse bags.
dark bronze bags contain 3 striped green bags, 2 wavy tan bags, 2 faded lime bags, 3 bright olive bags.
striped green bags contain 4 light black bags, 2 drab bronze bags, 4 dotted bronze bags, 3 plaid orange bags.
dark brown bags contain 5 drab indigo bags, 3 plaid white bags, 1 pale lime bag.
dotted black bags contain 4 dull beige bags, 4 drab lavender bags.
striped cyan bags contain 2 vibrant orange bags, 3 clear violet bags, 2 mirrored gray bags.
clear tomato bags contain 5 shiny gold bags, 1 dim chartreuse bag, 4 dark crimson bags, 5 shiny white bags.
light white bags contain 3 pale violet bags, 4 drab plum bags, 4 drab gray bags, 1 vibrant lavender bag.
plaid black bags contain 4 vibrant orange bags, 5 bright gray bags.
drab salmon bags contain 4 faded coral bags.
shiny maroon bags contain 3 pale black bags, 2 bright magenta bags.
striped black bags contain 1 plaid fuchsia bag, 4 plaid black bags, 1 mirrored beige bag.
muted bronze bags contain 5 faded red bags, 5 plaid green bags.
bright tan bags contain 1 wavy yellow bag, 5 light fuchsia bags, 5 plaid teal bags.
plaid gold bags contain 5 faded black bags, 1 vibrant black bag.
wavy tomato bags contain 5 plaid fuchsia bags, 2 mirrored violet bags, 3 dark yellow bags, 1 bright gold bag.
faded tan bags contain 5 vibrant salmon bags, 5 plaid teal bags, 4 clear aqua bags, 2 pale violet bags.
light crimson bags contain 3 mirrored tomato bags, 5 plaid green bags.
wavy bronze bags contain 1 light teal bag.
faded yellow bags contain 3 clear beige bags, 4 bright bronze bags.
muted gold bags contain 5 plaid teal bags, 2 faded fuchsia bags, 4 bright crimson bags.
shiny tan bags contain 5 dark salmon bags, 5 light red bags.
bright gold bags contain 2 faded chartreuse bags, 2 dim green bags, 3 striped cyan bags.
pale turquoise bags contain 1 pale tan bag, 5 dark violet bags.
wavy orange bags contain 5 plaid teal bags, 1 pale bronze bag, 4 wavy tan bags, 1 clear red bag.
dim silver bags contain 3 dark lime bags, 1 dotted beige bag.
faded cyan bags contain 2 dull maroon bags, 5 clear tan bags, 1 dull coral bag, 2 posh lavender bags.
dim white bags contain 1 dull maroon bag, 3 dull brown bags.
vibrant bronze bags contain 5 faded chartreuse bags.
dotted fuchsia bags contain 4 vibrant salmon bags, 2 faded white bags.
faded gold bags contain 2 dark maroon bags, 2 bright chartreuse bags, 1 dull brown bag.
dim brown bags contain 3 dull yellow bags, 4 faded chartreuse bags, 5 vibrant silver bags.
light yellow bags contain 2 striped silver bags.
striped coral bags contain 1 muted blue bag, 1 dim aqua bag, 4 posh red bags, 5 plaid lime bags.
dark magenta bags contain 2 pale violet bags, 2 vibrant tomato bags, 5 clear orange bags.
posh indigo bags contain 2 clear red bags, 4 clear violet bags, 2 shiny chartreuse bags, 5 dull white bags.
light tomato bags contain 4 clear indigo bags.
light plum bags contain 2 mirrored maroon bags.
drab violet bags contain 5 dark aqua bags, 1 vibrant magenta bag.
pale gray bags contain 1 striped lime bag, 4 clear bronze bags.
dark plum bags contain 2 dark olive bags.
plaid lavender bags contain 4 pale brown bags.
mirrored olive bags contain 1 faded coral bag.
drab green bags contain 2 dull silver bags, 2 clear purple bags, 3 posh violet bags, 2 light blue bags.
bright maroon bags contain 4 faded yellow bags, 4 dotted bronze bags, 2 dark brown bags.
striped purple bags contain 2 faded fuchsia bags, 5 posh plum bags.
wavy gray bags contain 4 dark violet bags, 4 plaid orange bags.
drab plum bags contain 3 light lavender bags, 1 striped blue bag, 5 bright crimson bags.
faded orange bags contain 4 light teal bags, 4 dim chartreuse bags, 2 vibrant yellow bags.
dim salmon bags contain 2 pale coral bags, 1 drab aqua bag.
muted silver bags contain 1 clear chartreuse bag, 2 clear tan bags, 5 dotted tan bags, 4 clear black bags.
muted yellow bags contain 3 wavy blue bags, 1 striped lavender bag.
wavy gold bags contain 5 faded gold bags, 1 shiny green bag, 1 mirrored cyan bag.
dull gold bags contain 1 striped green bag.
bright brown bags contain 4 drab plum bags, 4 pale violet bags, 5 vibrant blue bags.
bright crimson bags contain 2 wavy tan bags, 4 shiny teal bags.
mirrored gray bags contain 2 dull beige bags, 4 light white bags, 5 pale brown bags.
dull tan bags contain 4 dim magenta bags, 1 light teal bag.
mirrored yellow bags contain 1 drab lavender bag, 4 shiny gold bags, 3 drab turquoise bags, 2 light silver bags.
muted indigo bags contain 5 mirrored coral bags, 3 dark crimson bags.
dull aqua bags contain 4 drab lime bags, 3 shiny crimson bags, 1 drab salmon bag.
dim aqua bags contain 2 shiny lavender bags, 5 pale coral bags.
shiny chartreuse bags contain 1 clear maroon bag, 4 shiny blue bags.
dotted magenta bags contain 3 light olive bags.
faded green bags contain 4 faded beige bags, 5 dotted gold bags, 5 striped lavender bags, 5 wavy blue bags.
drab orange bags contain 3 muted fuchsia bags.
dim magenta bags contain 1 shiny orange bag.
shiny olive bags contain 2 wavy aqua bags.
dark orange bags contain 1 clear black bag, 1 faded gray bag.
light lavender bags contain no other bags.
bright turquoise bags contain 2 dull beige bags, 5 shiny teal bags, 5 posh brown bags, 5 dark beige bags.
faded purple bags contain 2 dark white bags, 2 pale salmon bags.
drab olive bags contain 1 dark silver bag, 4 plaid yellow bags, 3 drab gold bags, 2 mirrored yellow bags.
dull gray bags contain 3 vibrant turquoise bags, 5 faded chartreuse bags.
striped bronze bags contain 3 faded turquoise bags, 2 vibrant gray bags, 3 dotted beige bags, 3 dull beige bags.
wavy fuchsia bags contain 2 shiny purple bags, 2 plaid crimson bags, 1 dark cyan bag.
pale aqua bags contain 4 dotted tan bags, 1 dim yellow bag, 5 shiny lime bags.
pale silver bags contain 2 shiny brown bags.
shiny aqua bags contain 1 pale salmon bag, 5 faded chartreuse bags, 1 plaid aqua bag, 4 shiny silver bags.
posh brown bags contain 5 vibrant orange bags, 4 bright silver bags, 5 wavy orange bags, 3 dim chartreuse bags.
striped lime bags contain 5 drab violet bags, 4 light turquoise bags, 2 bright turquoise bags.
muted tan bags contain 2 striped purple bags, 4 posh yellow bags.
drab purple bags contain 2 clear red bags.
plaid magenta bags contain 2 pale blue bags, 5 plaid crimson bags.
mirrored tan bags contain 3 pale purple bags.
light blue bags contain 4 light tan bags.
clear black bags contain 2 pale blue bags, 4 dim gold bags, 2 vibrant gold bags.
light gold bags contain 1 wavy turquoise bag, 3 drab plum bags, 1 clear violet bag.
bright olive bags contain 3 light lavender bags, 1 faded tan bag, 3 shiny gold bags, 1 dotted cyan bag.
dark maroon bags contain 4 muted gold bags, 2 shiny yellow bags.
wavy lime bags contain 3 plaid green bags, 5 mirrored silver bags, 4 mirrored green bags, 3 dotted beige bags.
drab white bags contain 3 clear red bags, 3 bright silver bags, 4 posh red bags, 2 shiny blue bags.
clear lime bags contain 4 dotted orange bags.
vibrant maroon bags contain 2 dull orange bags, 5 vibrant crimson bags.
pale black bags contain 1 pale cyan bag, 5 dim tan bags, 4 shiny purple bags, 4 faded fuchsia bags.
vibrant tomato bags contain 2 mirrored orange bags.
dotted gray bags contain 3 dotted purple bags.
drab gold bags contain 4 shiny gold bags.
mirrored teal bags contain 3 shiny magenta bags, 3 mirrored beige bags, 3 dotted silver bags, 5 mirrored indigo bags.
posh lavender bags contain 2 wavy teal bags, 4 striped violet bags, 1 vibrant gold bag.
dark lavender bags contain 3 light blue bags, 2 muted beige bags, 3 clear magenta bags, 1 light tan bag.
muted cyan bags contain 4 dull gold bags, 1 dim yellow bag, 4 striped cyan bags, 2 dim gold bags.
dim maroon bags contain 5 shiny purple bags.
shiny purple bags contain 5 pale violet bags, 2 light fuchsia bags, 2 mirrored red bags.
vibrant lime bags contain 4 bright orange bags, 1 posh beige bag.
vibrant teal bags contain 2 posh turquoise bags, 3 pale tomato bags, 3 dark bronze bags.
posh fuchsia bags contain 3 striped plum bags, 2 drab aqua bags.
dotted violet bags contain 5 plaid black bags, 1 clear salmon bag, 2 dull chartreuse bags.
clear gold bags contain 2 dull violet bags, 3 muted white bags.
dull cyan bags contain 4 pale violet bags, 2 light gold bags, 4 dark tomato bags.
posh beige bags contain 5 mirrored cyan bags, 5 dotted red bags, 3 clear purple bags, 3 posh white bags.
dotted maroon bags contain 3 pale orange bags, 1 striped black bag, 4 faded fuchsia bags.
dotted tomato bags contain 5 striped magenta bags, 4 striped orange bags, 3 muted teal bags, 3 bright black bags.
drab teal bags contain 5 striped tan bags, 4 dull green bags, 5 muted coral bags, 1 clear red bag.
vibrant magenta bags contain 5 bright orange bags, 4 mirrored gray bags, 1 faded tan bag, 4 faded brown bags.
posh crimson bags contain 5 light lime bags, 1 faded brown bag, 2 posh red bags.
dull lavender bags contain 4 clear green bags, 5 wavy orange bags, 5 posh green bags, 3 plaid orange bags.
wavy yellow bags contain 2 light teal bags.
dotted bronze bags contain 3 clear red bags, 4 posh plum bags, 4 light lavender bags, 4 faded fuchsia bags.
dim olive bags contain 2 dotted chartreuse bags.
dark gray bags contain 3 shiny olive bags.
posh salmon bags contain 1 pale purple bag, 2 clear tomato bags, 4 shiny gold bags.
shiny coral bags contain 3 dark olive bags, 2 dull fuchsia bags, 1 dull gold bag.
vibrant green bags contain 2 light fuchsia bags, 5 vibrant violet bags, 3 dotted blue bags.
pale lime bags contain 4 vibrant gold bags, 5 dotted yellow bags.
vibrant yellow bags contain 5 clear violet bags, 1 dark maroon bag.
pale beige bags contain 4 faded red bags, 4 striped green bags.
dim bronze bags contain 5 posh chartreuse bags, 5 light white bags.
clear fuchsia bags contain 5 posh yellow bags, 4 faded fuchsia bags.
faded chartreuse bags contain 5 drab purple bags, 1 wavy olive bag, 3 light black bags, 1 dotted brown bag.
mirrored turquoise bags contain 1 faded fuchsia bag, 2 mirrored blue bags.
light maroon bags contain 4 dotted blue bags, 4 muted gold bags, 3 faded lavender bags.
muted crimson bags contain 5 posh bronze bags.
mirrored blue bags contain 1 faded lavender bag, 5 bright chartreuse bags, 4 dotted brown bags.
striped brown bags contain 2 clear cyan bags, 4 vibrant orange bags, 5 shiny tan bags.
muted orange bags contain 3 dotted black bags, 4 clear beige bags, 2 plaid beige bags, 1 mirrored coral bag.
clear beige bags contain 3 wavy tan bags, 5 dark aqua bags.
bright silver bags contain 3 striped purple bags.
muted plum bags contain 5 light purple bags, 1 light lavender bag, 2 drab maroon bags, 1 posh black bag.
vibrant salmon bags contain 1 shiny teal bag.
dotted chartreuse bags contain 4 vibrant gold bags.
shiny lime bags contain 3 dotted crimson bags, 3 striped crimson bags.
wavy brown bags contain 1 pale violet bag, 3 light beige bags, 2 wavy aqua bags, 4 dim teal bags.
clear yellow bags contain 3 dotted tan bags.
bright red bags contain 1 dim tomato bag, 5 clear tan bags, 2 posh red bags, 5 mirrored yellow bags.
drab tomato bags contain 1 drab yellow bag.
dull crimson bags contain 1 dotted brown bag, 2 bright gray bags, 4 dim tan bags.
shiny beige bags contain 2 plaid teal bags.
dotted coral bags contain 4 plaid teal bags, 2 pale turquoise bags, 4 dark lime bags, 2 pale purple bags.
shiny plum bags contain 5 dull coral bags, 1 shiny gold bag.
light coral bags contain 2 pale bronze bags, 1 clear aqua bag.
vibrant cyan bags contain 1 muted fuchsia bag, 4 pale tan bags, 1 shiny green bag, 1 dotted blue bag.
bright purple bags contain 4 faded white bags.
mirrored chartreuse bags contain 2 shiny orange bags.
light brown bags contain 4 striped violet bags, 4 striped purple bags, 3 wavy yellow bags, 2 drab blue bags.
clear brown bags contain 1 clear indigo bag, 2 dark coral bags.
vibrant fuchsia bags contain 4 dull tan bags, 4 vibrant bronze bags, 1 light white bag, 5 vibrant tomato bags.
clear crimson bags contain 5 muted tomato bags.
muted red bags contain 2 dull beige bags, 2 dark turquoise bags, 1 dark fuchsia bag.
dull salmon bags contain 2 bright tan bags, 5 faded white bags, 4 muted beige bags, 1 dull cyan bag.
drab lavender bags contain 1 dark chartreuse bag.
vibrant plum bags contain 1 dark violet bag, 2 mirrored red bags, 3 muted purple bags, 5 dull blue bags.
drab maroon bags contain 3 plaid teal bags, 4 muted beige bags, 4 posh gold bags, 5 mirrored coral bags.
posh magenta bags contain 4 wavy tomato bags, 3 wavy beige bags.
striped olive bags contain 3 shiny plum bags, 4 plaid gold bags.
vibrant crimson bags contain 2 dim chartreuse bags.
drab lime bags contain 1 vibrant aqua bag.
wavy maroon bags contain 2 dark tan bags, 4 faded brown bags, 4 dim silver bags, 1 muted lime bag.
dull tomato bags contain 2 dotted bronze bags, 5 vibrant maroon bags, 4 plaid tan bags.
dim teal bags contain 5 muted beige bags, 2 mirrored indigo bags, 4 vibrant lavender bags.
wavy white bags contain 1 muted white bag, 1 dim chartreuse bag.
bright lime bags contain 3 dull gold bags, 2 dull indigo bags, 4 drab teal bags.
plaid aqua bags contain 4 light lavender bags, 4 posh gold bags, 3 wavy violet bags, 5 muted chartreuse bags.
mirrored purple bags contain 3 dark lavender bags, 3 clear salmon bags, 1 plaid white bag, 1 striped violet bag.
plaid maroon bags contain 4 dotted red bags, 1 mirrored coral bag, 5 muted indigo bags, 1 clear turquoise bag.
dark turquoise bags contain 4 bright crimson bags, 2 dotted bronze bags, 2 pale violet bags, 5 wavy aqua bags.
dull silver bags contain 2 wavy olive bags, 5 shiny violet bags.
muted olive bags contain 5 plaid beige bags, 3 dark brown bags, 1 clear black bag, 4 faded red bags.
drab indigo bags contain 1 pale violet bag.
muted lime bags contain 5 striped violet bags, 2 plaid lavender bags.
drab blue bags contain 1 pale tomato bag.
drab bronze bags contain 3 vibrant blue bags, 1 vibrant bronze bag.
muted gray bags contain 4 dim chartreuse bags.
striped teal bags contain 4 dark coral bags.
light green bags contain 2 plaid teal bags, 5 pale bronze bags, 3 dull teal bags.
plaid salmon bags contain 3 bright chartreuse bags.
dotted blue bags contain 4 drab plum bags, 1 light tan bag.
dark violet bags contain 5 dark coral bags, 5 dotted lavender bags, 5 pale brown bags, 1 vibrant lavender bag.
pale gold bags contain 1 bright silver bag, 2 dark cyan bags, 1 dull tan bag, 1 plaid blue bag.
light turquoise bags contain 3 drab turquoise bags, 1 dull tan bag, 3 muted indigo bags, 5 dotted fuchsia bags.
plaid blue bags contain 3 pale violet bags, 4 dotted brown bags.
bright magenta bags contain 4 shiny brown bags, 4 wavy violet bags, 3 dark aqua bags, 2 bright turquoise bags.
clear maroon bags contain 4 posh plum bags.
posh red bags contain 5 plaid cyan bags, 4 clear orange bags.
posh purple bags contain 5 plaid cyan bags, 1 drab lavender bag, 3 pale purple bags, 4 light coral bags.
dim lime bags contain 2 striped beige bags, 2 dark blue bags.
shiny indigo bags contain 2 vibrant black bags, 2 wavy orange bags.
posh gold bags contain 5 dull beige bags, 1 shiny teal bag.
wavy beige bags contain 2 dark beige bags, 4 muted chartreuse bags, 2 dim lavender bags, 2 mirrored indigo bags.
dim lavender bags contain 2 vibrant aqua bags.
mirrored beige bags contain 2 posh red bags, 3 pale olive bags, 3 dull brown bags.
clear indigo bags contain 1 shiny teal bag, 1 mirrored indigo bag.
dim chartreuse bags contain 5 bright tan bags.
plaid coral bags contain 2 clear green bags.
wavy cyan bags contain 2 drab blue bags, 5 dotted coral bags, 3 mirrored beige bags.
dotted crimson bags contain 1 muted tan bag, 4 dull maroon bags, 2 striped crimson bags.
drab cyan bags contain 1 dull cyan bag, 3 pale cyan bags, 4 faded aqua bags, 4 clear tan bags.
wavy coral bags contain 4 wavy plum bags, 5 plaid beige bags, 5 pale tan bags.
pale maroon bags contain 5 pale tan bags.
shiny blue bags contain 3 light coral bags, 4 bright olive bags.
plaid orange bags contain 2 dim white bags, 3 shiny silver bags, 3 pale violet bags.
dark tan bags contain 2 vibrant olive bags, 3 plaid turquoise bags, 2 dull chartreuse bags, 4 dull teal bags.
posh cyan bags contain 5 posh orange bags, 5 shiny brown bags.
clear red bags contain no other bags.
light fuchsia bags contain 4 dark beige bags, 1 light black bag, 1 striped blue bag.
striped beige bags contain 2 bright silver bags, 2 faded indigo bags, 1 plaid turquoise bag, 3 shiny plum bags.
wavy lavender bags contain 4 posh black bags, 1 dotted teal bag, 4 drab purple bags.
dotted cyan bags contain 5 dull yellow bags, 5 light beige bags, 2 vibrant aqua bags, 5 dark beige bags.
drab crimson bags contain 5 dark magenta bags.
plaid olive bags contain 1 vibrant crimson bag, 5 dim bronze bags, 1 striped black bag, 1 drab brown bag.
dim yellow bags contain 3 plaid gray bags, 5 vibrant salmon bags, 4 vibrant olive bags.
striped indigo bags contain 3 mirrored coral bags, 2 vibrant bronze bags, 3 dull brown bags.
dark green bags contain 3 shiny teal bags, 5 pale chartreuse bags, 5 dull teal bags, 5 striped silver bags.
drab aqua bags contain 5 dark aqua bags, 5 dotted blue bags, 1 pale violet bag, 1 pale bronze bag.
striped orange bags contain 3 striped green bags, 4 muted beige bags, 2 clear aqua bags, 3 dark crimson bags.
striped silver bags contain 1 pale cyan bag, 5 drab gold bags, 3 bright turquoise bags, 4 light gold bags.
bright blue bags contain 4 light black bags, 1 plaid salmon bag.
striped red bags contain 1 vibrant plum bag, 5 dull blue bags, 1 dull olive bag.
posh white bags contain 3 drab bronze bags, 4 bright crimson bags.
drab turquoise bags contain 4 striped crimson bags.
clear lavender bags contain 4 faded magenta bags, 1 mirrored gray bag, 4 wavy yellow bags, 1 dotted cyan bag.
drab chartreuse bags contain 1 shiny gray bag.
clear purple bags contain 1 shiny brown bag, 2 bright gray bags, 5 clear salmon bags.
dull magenta bags contain 1 posh cyan bag, 3 muted indigo bags, 1 dim lavender bag.
posh chartreuse bags contain 4 wavy violet bags.
posh maroon bags contain 4 striped gray bags.
clear blue bags contain 3 faded lime bags, 2 pale purple bags.
dark gold bags contain 2 dull beige bags, 3 plaid blue bags.
muted coral bags contain 4 dark gold bags.
bright aqua bags contain 3 muted crimson bags.
dull orange bags contain 3 posh gold bags.
shiny turquoise bags contain 3 dark brown bags, 5 shiny red bags, 3 muted beige bags.
mirrored brown bags contain 2 light orange bags, 5 drab coral bags, 2 wavy lime bags.
striped chartreuse bags contain 1 dark lavender bag, 4 pale salmon bags, 4 dotted violet bags, 4 clear tomato bags.
shiny salmon bags contain 4 dim magenta bags.
bright fuchsia bags contain 4 muted chartreuse bags, 3 mirrored green bags.
shiny tomato bags contain 5 clear gray bags, 2 drab silver bags, 3 clear green bags.
muted turquoise bags contain 5 shiny orange bags, 1 mirrored tan bag.
vibrant tan bags contain 1 faded magenta bag, 5 drab plum bags.
posh gray bags contain 2 posh magenta bags.
dark lime bags contain 5 clear aqua bags, 3 posh plum bags.
plaid violet bags contain 2 light bronze bags, 1 light green bag, 1 striped gold bag.
vibrant blue bags contain 2 wavy yellow bags, 4 dim magenta bags, 1 drab maroon bag, 4 dotted brown bags.
faded brown bags contain 2 pale blue bags, 4 bright olive bags, 1 bright bronze bag.
striped salmon bags contain 4 light green bags, 4 wavy orange bags, 3 mirrored coral bags.
plaid lime bags contain 1 bright green bag, 2 light indigo bags.
plaid chartreuse bags contain 4 vibrant green bags, 5 dotted coral bags, 2 muted gray bags, 4 bright purple bags.
light salmon bags contain 5 vibrant maroon bags, 3 dark lime bags, 5 drab tan bags, 1 striped cyan bag.
muted fuchsia bags contain 4 light silver bags, 3 light teal bags, 3 muted gold bags.
clear plum bags contain 5 light turquoise bags.
posh orange bags contain 5 wavy tan bags, 4 dark turquoise bags.
dotted tan bags contain 2 plaid teal bags.
shiny teal bags contain no other bags.
posh violet bags contain 2 vibrant tomato bags, 4 bright orange bags, 3 dotted red bags, 5 pale silver bags.
dotted lime bags contain 5 wavy tan bags, 2 dark tomato bags, 5 mirrored gray bags, 2 light aqua bags.
posh plum bags contain no other bags.
mirrored white bags contain 4 clear gold bags, 1 dark teal bag.
pale indigo bags contain 4 shiny magenta bags, 1 shiny maroon bag.
drab beige bags contain 1 muted plum bag, 5 posh turquoise bags, 2 vibrant fuchsia bags.
faded black bags contain 5 wavy black bags.
plaid beige bags contain 2 posh purple bags, 4 pale olive bags, 3 striped green bags, 5 bright orange bags.
faded white bags contain 4 clear red bags, 4 faded fuchsia bags, 1 dull beige bag.
shiny violet bags contain 3 shiny green bags, 5 wavy brown bags.
wavy blue bags contain 2 light teal bags, 4 dull silver bags, 2 bright black bags, 4 dull tan bags.
wavy red bags contain 4 dark silver bags, 5 dotted chartreuse bags, 2 clear salmon bags, 2 striped tan bags.
shiny lavender bags contain 2 muted bronze bags.
faded coral bags contain 5 dotted chartreuse bags, 2 vibrant silver bags, 2 wavy black bags.
clear coral bags contain 4 muted fuchsia bags.
mirrored coral bags contain 1 vibrant lavender bag.
dim black bags contain 2 bright olive bags, 1 dull teal bag, 4 shiny purple bags.
pale blue bags contain 1 light black bag, 2 light white bags, 1 dull maroon bag, 5 plaid teal bags.
plaid plum bags contain 3 muted coral bags, 1 dim brown bag, 2 plaid aqua bags, 1 vibrant blue bag.
muted black bags contain 5 light blue bags, 3 clear salmon bags.
dotted white bags contain 3 shiny salmon bags, 1 faded maroon bag.
drab coral bags contain 3 striped gold bags, 4 shiny aqua bags, 5 wavy red bags.
dotted salmon bags contain 4 drab black bags, 2 light aqua bags.
mirrored indigo bags contain 3 wavy orange bags, 5 posh plum bags.
vibrant violet bags contain 1 striped lavender bag, 1 muted purple bag, 2 drab silver bags, 5 pale olive bags.
plaid teal bags contain 4 shiny teal bags, 2 wavy turquoise bags, 2 vibrant aqua bags.
dull violet bags contain 5 light coral bags, 1 vibrant tan bag.
faded crimson bags contain 3 dark chartreuse bags, 2 vibrant cyan bags, 3 mirrored cyan bags.
posh bronze bags contain 4 plaid lavender bags, 3 shiny gold bags, 5 mirrored coral bags, 2 shiny indigo bags.
clear olive bags contain 2 muted gray bags, 2 dark red bags, 5 clear brown bags, 5 bright silver bags.

View File

@@ -0,0 +1,636 @@
acc -13
jmp +37
acc -19
jmp +1
jmp +1
jmp +413
acc +10
jmp +194
jmp +587
jmp +388
acc +48
nop +284
acc +35
jmp +239
acc +0
jmp +58
acc +22
acc +45
acc +25
acc +23
jmp +544
jmp +610
nop +273
jmp +554
jmp +584
acc +30
jmp +481
acc +29
jmp +342
acc +9
acc +23
nop +377
jmp +483
acc +33
jmp +128
nop +560
nop +437
jmp +485
acc +2
acc +30
jmp +456
acc +0
acc -15
nop +126
acc +47
jmp +299
acc +36
acc +9
jmp -21
acc +10
acc +26
acc -3
acc +31
jmp +337
nop +517
jmp +303
acc +20
nop -43
acc +30
acc +24
jmp +348
jmp +158
acc +23
acc +16
acc +40
jmp +1
jmp +465
acc +12
jmp +276
acc +0
acc +32
acc +43
jmp +487
acc +40
acc +49
nop +540
jmp +455
acc +24
jmp +481
acc +30
nop +256
acc +29
acc +14
jmp +390
jmp +1
acc -3
jmp +1
jmp +295
acc +6
acc +46
acc +16
nop +128
jmp -38
acc +0
acc +16
acc +10
jmp +185
acc -19
acc +0
acc +23
acc -16
jmp +180
acc +14
jmp +1
acc +31
acc -4
jmp +439
jmp +204
acc +50
acc +12
nop +154
jmp +474
acc -16
jmp +511
acc +6
acc +32
jmp +504
acc +17
acc +21
acc -18
jmp +298
acc -17
acc +16
acc +4
acc +18
jmp +18
acc -10
acc +26
acc +36
jmp +166
nop -109
jmp +266
acc -9
jmp +306
nop +324
acc +16
acc +33
acc +18
jmp -50
acc +25
jmp +196
acc +21
jmp +308
jmp +38
acc +27
jmp -48
acc +14
acc +46
acc +48
acc +15
jmp +223
acc +0
acc +12
jmp -115
acc +19
acc +27
acc +30
jmp +377
jmp -144
jmp +231
acc +1
jmp +410
acc +41
jmp +138
acc -13
acc -8
acc -7
acc +25
jmp +366
acc +8
jmp +182
acc +2
nop +104
acc +24
acc +21
jmp -43
acc -8
acc +37
acc +23
jmp +292
jmp +365
acc +33
nop -144
acc -10
jmp +387
acc +13
acc -6
acc -12
nop +134
jmp +345
acc +5
acc +16
acc +35
acc +50
jmp +250
acc +46
jmp +105
acc -6
nop -152
jmp +233
jmp -88
acc +39
jmp +59
acc -4
acc +47
jmp +165
acc +32
acc +49
acc +24
jmp +344
acc -5
acc +3
jmp +359
acc +27
jmp +72
acc +0
acc +16
acc +40
jmp +98
acc +2
acc +23
acc +48
acc +2
jmp -33
jmp -186
acc +27
nop -83
acc +2
acc +19
jmp -141
acc +39
acc +34
acc +33
jmp +282
jmp +306
acc +12
jmp +317
acc +32
acc +50
acc +17
jmp +52
acc +3
acc +35
jmp +328
acc +26
nop +163
acc +6
acc +19
jmp +154
acc +4
jmp +1
jmp +373
acc -12
acc +47
jmp +1
jmp -234
acc +45
acc +46
acc -14
acc +50
jmp -134
acc +26
jmp +128
jmp +233
acc +23
nop -133
jmp -154
jmp +260
acc +21
acc +14
nop -89
acc +9
jmp -113
acc +10
acc +5
jmp +127
acc -9
acc +2
jmp +286
nop +274
jmp +93
acc +46
acc +36
jmp +53
acc +30
jmp -126
acc +11
acc +11
acc +23
jmp +296
nop -100
jmp +304
jmp +219
acc +16
jmp -93
acc +12
jmp +1
jmp +205
acc +6
acc -11
jmp +202
jmp +107
jmp +1
jmp -224
acc +24
acc +50
acc +37
jmp +45
acc +25
acc -15
jmp -151
jmp +1
acc +47
jmp -196
jmp +1
jmp +300
jmp +116
acc +39
acc +0
nop -176
acc -7
jmp -53
acc +20
nop -216
nop +291
jmp +38
acc +0
acc +32
acc -19
jmp -28
jmp -176
acc +33
acc +11
acc +47
nop -58
jmp -203
acc +48
acc +50
acc +41
jmp -315
acc -12
acc +23
acc +32
jmp +210
acc +46
acc -11
acc -16
jmp +103
acc +25
nop +95
acc +9
jmp -117
nop +18
acc -19
acc +38
jmp -130
acc +22
jmp +25
nop +201
nop +205
acc +14
jmp -124
jmp -46
acc +9
jmp -257
acc -19
acc -17
acc +36
acc +24
jmp -210
jmp -231
acc +40
jmp +46
nop -192
acc -13
acc +7
acc +33
jmp +103
acc +18
acc +37
acc -14
jmp -11
acc +12
nop -240
acc +35
acc +33
jmp -274
acc -9
acc +24
jmp -128
nop -129
acc -17
jmp -62
acc +0
acc +42
nop +116
jmp -44
acc +16
jmp +179
acc -8
acc +8
jmp -149
acc +39
acc +2
acc +14
acc +12
jmp -373
jmp +76
jmp -232
jmp -385
acc +22
acc +41
acc +28
jmp -179
acc +0
acc +22
acc +15
jmp -291
acc -18
jmp -222
acc +45
acc -15
jmp +61
acc +10
acc +16
acc +43
jmp +177
acc +43
acc -12
acc +20
acc +27
jmp -13
acc -14
jmp -336
nop -158
acc +3
nop -409
acc +17
jmp -257
acc +0
nop +124
jmp +1
jmp +117
jmp -179
acc -17
acc -2
jmp +1
jmp -37
acc +42
jmp +175
acc -9
acc +12
acc +4
jmp +69
acc -7
jmp +1
acc +32
jmp +54
jmp -444
acc +7
jmp -87
acc -6
nop -323
acc +47
acc -5
jmp -143
jmp +1
nop -44
acc +27
acc +21
jmp -184
jmp -404
jmp -70
acc +32
jmp -13
acc +0
nop -452
acc +1
acc +31
jmp -77
jmp -401
acc +42
jmp -428
nop -120
acc -17
nop -75
acc +6
jmp +20
jmp -291
acc +7
jmp +37
acc +10
acc +15
jmp +1
acc +11
jmp -363
acc -14
nop -321
jmp -40
acc +41
acc +31
jmp +58
jmp -493
acc +32
acc -10
acc +44
jmp -211
acc +47
acc +23
jmp -241
jmp -224
acc -1
jmp -350
acc +8
jmp -280
acc -19
acc +0
acc +17
jmp -274
acc +27
acc +11
jmp -82
acc +48
acc +27
jmp -518
acc +3
jmp -124
jmp +1
jmp -490
acc +41
jmp -238
acc -6
jmp -386
jmp -189
acc -11
jmp +80
acc -8
acc +9
nop -99
jmp +56
acc -18
jmp -83
acc +28
acc +13
jmp -228
acc +32
acc +34
acc +3
jmp -272
nop -410
acc +13
acc -17
jmp -236
acc +45
acc +0
acc +19
nop +29
jmp +38
jmp -75
acc +7
acc +33
acc +40
jmp -180
jmp -557
acc +22
jmp -249
acc +44
acc +45
acc +2
acc -19
jmp -537
acc +44
acc +32
acc -14
acc +39
jmp -406
jmp -488
acc +14
acc +41
jmp -327
acc +17
acc +25
nop -573
acc +0
jmp -563
acc +18
nop -282
acc +13
acc +45
jmp -325
acc +41
acc -10
nop -47
nop -223
jmp -155
acc +14
acc +23
jmp +23
acc +21
nop -229
acc +27
acc -5
jmp -95
acc +2
acc -10
nop -451
jmp -393
jmp -406
acc +42
acc +18
acc +49
jmp -307
acc -11
jmp +1
jmp -424
jmp -192
acc +49
acc -1
acc -17
jmp -355
jmp -268
nop -320
acc +1
jmp -134
acc +46
jmp -564
acc +40
acc +29
acc +13
nop -285
jmp -272
acc +19
acc -14
acc +25
acc +18
jmp +1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
153
69
163
123
89
4
135
9
124
74
141
132
75
3
18
134
84
15
61
91
90
98
99
51
131
166
127
77
106
50
22
70
43
28
41
160
44
117
66
60
76
17
138
105
97
161
116
49
104
169
71
100
16
54
168
42
57
103
1
32
110
48
12
143
112
82
25
81
148
133
144
118
80
63
156
88
47
115
36
2
94
128
35
62
109
29
40
19
37
122
142
167
7
147
121
159
87
83
111
162
150
8
149

View File

@@ -0,0 +1 @@