Day02: Add class with statement and input data

This commit is contained in:
2018-12-03 14:34:07 +01:00
parent af835ebc76
commit 0d0d7c7291
3 changed files with 295 additions and 0 deletions

View File

@@ -44,6 +44,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Day01.cs" />
<Compile Include="Day02.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -51,6 +52,9 @@
<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>

41
AdventOfCode2018/Day02.cs Normal file
View File

@@ -0,0 +1,41 @@
using System;
namespace AdventOfCode2018
{
/*
--- Day 2: Inventory Management System ---
You stop falling through time, catch your breath, and check the screen on the device. "Destination reached. Current Year: 1518. Current Location: North Pole Utility Closet 83N10." You made it! Now, to find those anomalies.
Outside the utility closet, you hear footsteps and a voice. "...I'm not sure either. But now that so many people have chimneys, maybe he could sneak in that way?" Another voice responds, "Actually, we've been working on a new kind of suit that would let him fit through tight spaces like that. But, I heard that a few days ago, they lost the prototype fabric, the design plans, everything! Nobody on the team can even seem to remember important details of the project!"
"Wouldn't they have had enough fabric to fill several boxes in the warehouse? They'd be stored together, so the box IDs should be similar. Too bad it would take forever to search the warehouse for two similar box IDs..." They walk too far away to hear any more.
Late at night, you sneak to the warehouse - who knows what kinds of paradoxes you could cause if you were discovered - and use your fancy wrist device to quickly scan every box and produce a list of the likely candidates (your puzzle input).
To make sure you didn't miss any, you scan the likely candidate boxes again, counting the number that have an ID containing exactly two of any letter and then separately counting those with exactly three of any letter. You can multiply those two counts together to get a rudimentary checksum and compare it to what your device predicts.
For example, if you see the following box IDs:
abcdef contains no letters that appear exactly two or three times.
bababc contains two a and three b, so it counts for both.
abbcde contains two b, but no letter appears exactly three times.
abcccd contains three c, but no letter appears exactly two times.
aabcdd contains two a and two d, but it only counts once.
abcdee contains two e.
ababab contains three a and three b, but it only counts once.
Of these box IDs, four of them contain a letter which appears exactly twice, and three of them contain a letter which appears exactly three times. Multiplying these together produces a checksum of 4 * 3 = 12.
What is the checksum for your list of box IDs?
*/
public class Day02
{
public string ResolveDay02(string[] inputs)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,250 @@
pnebjqralgdgckzfifvtxywomu
pnebjqsalrdgcqzfihotxhwomu
pneajqsalrdgckzfihytxywoml
pnepjqsalrwgckztihvtxywomu
pnhbjqsalrdgckzfimvtxywodu
pnwbjqsdlrdgckzfihvnxywomu
inebjqnalrdgckzfihvtxzwomu
pnebjssalhdgckzfihvtsywomu
pnebjqjalrdgckzfiavtxywoku
vnebjqsalrdgckzfihvbxmwomu
phebjksaurdgckzfihvtxywomu
pneojqealrdgckzhihvtxywomu
snebjqsalrdgckzqihvtxyzomu
pnebjqsalrtackzfihvtxswomu
bnebjqlalrdgckzfihvtxywhmu
pnebjqfalrdgckzfijvtxywomi
fnehjbsalrdgckzfihvtxywomu
pnebjasalrdgckzdihvtxqwomu
pnebjhsaljdgckzfihvtxywmmu
pnebjqsalrdgckzfihvsxykoau
pnebjqsalrdgckzbihvtdywomc
pnobjqsalrxgckzfihvtxywomh
pnebjqstlrdgchzfihvtxywnmu
pnebjquaxrdgckzfihvtxywolu
pqebjqsalrdgcdzfihvtcywomu
xnabjqsalrdgckzfihvtxywmmu
rnebjqsalrdgckzfihvtxmwouu
vaebjqsalrdgckcfihvtxywomu
pnebjqsalrpgcnzfihvbxywomu
pcvbjqsalrdjckzfihvtxywomu
pneyjqsafrdgckzfihdtxywomu
pxedjqsalrdgckzfihvtxyzomu
pnebjqsalrdgctzfihnyxywomu
pnebjqsalrdgckzfihvtnylsmu
pnebjqsalrdyckzfihvbxycomu
fnebjqsalrdgckzfihvtxtwomc
pnobjqsalrdgckdfihvtxywomh
pqebjqsalrdgcqzfihvtxywymu
pnebxqsalrdgckzficvtwywomu
pnebjqshlragczzfihvtxywomu
pnebqqsalrdackzfihttxywomu
pnebjqsalrdsckwfbhvtxywomu
pnehjqsalrdgcuzfxhvtxywomu
pnebjqsavrdgckzfihvexywomn
pnebunsalrdgckzfihvtxywomi
pnebjxsalrdgckzfmhvtpywomu
rnebjqsalrdghkzfihztxywomu
pnebjqsalrigcbzfihvfxywomu
pnebqqsalrggckzfihvtxyromu
pnebjqsalrdgchzfihvtxylmmu
pnebeqsalrdgckzdihvtxywoms
pnebjqsalrdgckzzihvfxywozu
pnzbjgsalrtgckzfihvtxywomu
pnebjqsaledgckzjihvtxzwomu
pnebjqsalydgckqfihvtxywouu
pnebjqsalrdgckufihvqxdwomu
pnebjqsylrdgckzfihvdxyjomu
pnemjqsalrdgckzeihvtxywoqu
plebjasalrdgckzfihvtxywomb
pnebjqsadrdgckufihvtxyfomu
pbebjqsaardgckzfihvtxmwomu
pnebjqsalrdgcmzfihotxywgmu
pnebjqsaprdgcizfihvtxywhmu
pnebjqsalrkgcuzfihvtlywomu
pnebjqsalrdnckzfihvtxysomg
pnebjqdafrdgckzfihctxywomu
pnebjqsalrdgckzfihutxkwomp
pnebvqsalrdgclzfimvtxywomu
pnebjqralrdgcktfihvtxiwomu
pneujqsalrdsckzfzhvtxywomu
pnebfqgalrdgckzfihvtxywjmu
pneyjqsalrkgckzfihctxywomu
pndbjqsalrdgckzfjhvtxywouu
pneljnsalrdgcozfihvtxywomu
phebjqsalrdgckzfihxtxdwomu
pnlbjqsalrhgckzfzhvtxywomu
pnebjqsalrsgckzfiovtxywwmu
pncbjqsalrdgfkzfivvtxywomu
nnebjqsalrdgckzfthvtxycomu
pnebjqwalsdgckzfixvtxywomu
pnebjtsalrdgcfzfimvtxywomu
pnebjqsvlrdgckzfihutxfwomu
pnebjmsalrdgckzkxhvtxywomu
pnekjqsllrdgckzfinvtxywomu
pneijqsxlrdgckzfihvtxywjmu
wnxbjqsafrdgckzfihvtxywomu
pnebjqskledgokzfihvtxywomu
pnebjqvalrdgckzfihvtxytoju
pneqjqsalrdgckzfilvthywomu
pnebjqsalrdgckzfihvokywomf
bnebjqsalrdgckufihvtxywimu
pnebjqsaurdgckzfihvtrywosu
pnebjmsaludgckzfihvtxywomn
pnebdqsalrdgcktfihvtxywodu
pnebjqjylzdgckzfihvtxywomu
piebjqsalrdgcrzfihstxywomu
pnebjqsaurdgckwfnhvtxywomu
pnebxqsajrdgcjzfihvtxywomu
pnebjqsalrdghsdfihvtxywomu
pnebcqsxlrdgckzfihvtxyaomu
pnefjqsalrdgckzfuhvtxyworu
pnebjqsalrdlcksfihvteywomu
pnebjqlalrgackzfihvtxywomu
pnebdqsalrdickzfihvtxdwomu
pneujksalrdgctzfihvtxywomu
pnebjqsalrduckzfihvsxywomf
pnebjqsalrdgckcfihotxywomd
envbjqsalsdgckzfihvtxywomu
pnebjqsalzdgcvzzihvtxywomu
pnebjqsalrdyckzflhvyxywomu
pnebjqsalrdglkzfihstxymomu
pnebmqsalrdgokzfihvtxywoml
pnebjqsylrdnckzfihatxywomu
pnebjqaflndgckzfihvtxywomu
pneboqsagragckzfihvtxywomu
peebjqstlndgckzfihvtxywomu
onebjqsklrdgckzfihvtxmwomu
pnebjqjnlrdgckrfihvtxywomu
pnebjqsalrhgckzfihvqxywomh
pnebjqsalrdgckzzihvtxowomw
pnebjgsalrdgckffihltxywomu
znebaqsalcdgckzfihvtxywomu
pnnbjqeasrdgckzfihvtxywomu
rnebjqaalrxgckzfihvtxywomu
pnebjqsalrdgckaxphvtxywomu
pnebjcnalrdgnkzfihvtxywomu
pnebjasalbdgckzmihvtxywomu
pnebjqsalrdgckefjhvtmywomu
pnebjqsalrdgmkzfihvtxyoomb
pnebjqsalrkgckogihvtxywomu
pnwbjqsalrdgckztihvtxywomt
pnebjqsalrdgckzfihotgnwomu
pnebjqsdlrrgckzfihvtxyaomu
pnebvasalrdgckzfihvtsywomu
pnebrqqalrvgckzfihvtxywomu
tnebjqsglrdgqkzfihvtxywomu
pnebjqsatrsgckifihvtxywomu
pneboqsalrdgckzfihvkxywomi
pnezaqsalrdgcktfihvtxywomu
pnebjqsnlrdgckzfihvfxqwomu
pneajqsaxrmgckzfihvtxywomu
pnebjosalodgckzfihvxxywomu
pnebjqsalndgckmfihvtfywomu
pneejqsalidgckzfihgtxywomu
pnecjqsalrdgckzfihptxiwomu
tnebjqsalrdgckznihvxxywomu
ptebjqsalrdgckzfimvtxywomm
wnebjqsalndgckzfihvtxywoju
fnebmqsplrdgckzfihvtxywomu
pnlbjqsalrdghkzficvtxywomu
pnebjqsesrdgckzdihvtxywomu
pnebjqsalregokzfirvtxywomu
pnebjtualrtgckzfihvtxywomu
pnebjwsdlrdgckzfihvtxywoml
pnlbjqsayrdgckzfqhvtxywomu
pnebjwsalpdgckzfihvtxywomc
pnqbjqsalcdgckzhihvtxywomu
pneujqsalrdgckzfhhvtxrwomu
pnebjqsalqdgcizfihvtxywimu
pnebjqsacldgckzfihvwxywomu
puebjqsalrdgckzfbhvtxyeomu
pnebjqsalrdgcyimihvtxywomu
pnebjlsalrdgckzfihvtxiwome
pnebfusalrdgckzfihvtxywodu
pnebjqsalrdgvazfirvtxywomu
pnebjqsalrdgckyfohvtxywomz
gnenjqsalrdgckzfihvtxynomu
mnebjqsalrdgckhfihvtxycomu
phebjqsalrdgckzfihvtxtworu
pnebjqsalrdgdkzfihvtxywfmj
pneveqsairdgckzfihvtxywomu
pnebjqsalcdlckzfihvtxywomg
pneajqsalrdgckzfihvtxygoxu
puebjqdclrdgckzfihvtxywomu
tuebjqsalrdgckzfihvtxywoou
pwenjqsalrdgckzfihvtxywomg
pnebjqsalrdgckzfihhltywomu
pnebjqsalrdgchzqievtxywomu
pnegjqsalrdgckzfiovtxywdmu
pnebjaralrqgckzfihvtxywomu
pnebjqsalrdrckzfimvtxywomm
pnebjqsalrdgckzfpgvtxewomu
pnebjqsalrdhcqzfihitxywomu
pnebjqsalrjgckefihmtxywomu
pnebjcsalrdgcksfikvtxywomu
pnebjqsalrdgckzfihvtxywdjc
pnebjqsazrjgckzjihvtxywomu
pnfbjqsclrdgckzfihvtxybomu
pnebjqsalrdgckuqihvtxyaomu
pfpbjzsalrdgckzfihvtxywomu
pnevjqsalrdgckwfihytxywomu
pnebjqsqlrkgckzfihvtvywomu
pneejqsalrdlckzfihvtxywopu
pnebjqsalcdgxkzfihvtxywomd
pneqjqsalrdgcvzzihvtxywomu
pnvbjqsalydgctzfihvtxywomu
pnebjqsalrdgckzzihvfxywomn
pnybjqsaerdgckzfihstxywomu
pnobjqsalrdkckzfihvtxywomv
pnebjqsalridckzfihvtxywfmu
pnhbjqsaludgckyfihvtxywomu
pnetjqsaprdgykzfihvtxywomu
wnebjqsalrdvcfzfihvtxywomu
pnetjqsalrdmckwfihvtxywomu
pnebjysalrdgcszfihvtxnwomu
pnebjqsrlrdgckzfihvtxywkhu
pnubjqsplrdgcjzfihvtxywomu
pnebjqsalrdzckzficjtxywomu
pnebjqsalregckzfinvtxywoku
pnebjqsalrcgckyfivvtxywomu
pyenjqsalrdgckzfihvnxywomu
prebjqsalrdnckzfihvtxysomg
pnebjnsalrdgchzfihvaxywomu
pnebjqsalrdgckzfihxagywomu
pnebjqsalrdgckzvihvtoywoml
pnebjqsilrdgckzfihvtfywgmu
pnebjqmalrdgckzfihvtvawomu
pnebqqsalrdgckzfiuvtfywomu
pneqjqsalrdgckzfihvqxywomi
pnebjesalrsgckzfihvtxywmmu
znebjqsblrdgckzfihvlxywomu
pnebjqsalrdgckzfuhvtlyworu
pnebjqsylrdgckzfihvqxpwomu
onebjqsalfdgckifihvtxywomu
pnebjusalrdgckzfihvtxywyml
pnebjssflrdgckzfigvtxywomu
pnebjfsdzrdgckzfihvtxywomu
pnebjqsalrdgcktfihvixywocu
gnebjqnaqrdgckzfihvtxywomu
pnebjqsaqrugckzfihhtxywomu
pnebjqsxlrdgckzfihvtxlwosu
pnebjzsalrdgckzmihvtxywovu
pnebgqsalrdgckzfizvtxyjomu
pnebjqsmlrdgckzfihvtxywsmi
pnebjqsakmdgckzjihvtxywomu
pnebjqdglrdgckvfihvtxywomu
pnebmhsalrdgckxfihvtxywomu
pneejqsalrdlckzfihvnxywomu
bnebjqsalmdgckzfihvfxywomu
bnebjnsalrdgcizfihvtxywomu
pnebjqsalhdgcdzfihvbxywomu
pnebjqsjlrdgckzfihvgiywomu
pnebjisalrdgckzfihvtxywqmi
pdebjqsalrdickzfihhtxywomu
pnebjqsalrdkckzfihvjeywomu
pneyjqsalrqgckzfihvtxywohu
pnebjqsalrdgckcfihvtxjlomu
plebqwsalrdgckzfihvtxywomu
pnebjqlalrdgckzfihetxynomu
sngbjqsalrdgckzfihvmxywomu