Skip to content

Commit c216b7d

Browse files
committed
8.1
1 parent 0b265ed commit c216b7d

File tree

5 files changed

+256
-1
lines changed

5 files changed

+256
-1
lines changed

inputs/day08-display.txt

+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
bgcfda gecbda abdgf aedfbg eda efcbd ae agfe bdefagc fbeda | ae egdafb ea fcdeb
2+
gfadb fbagcd cagf agecdb adg fdbcg bdcfaeg bcgfde ga efbda | cbfdge dfcebga aedcgb dgbfa
3+
bgdeca agdbe gfb fdbgce bf eafb dfgab efbgdca gebafd dgcaf | gfbdea gfb bacedg adcgf
4+
fbc becgdf fcbdg adcgf edafgb bgec dcgfbea gbfed bc cbeafd | gfacd gcbdf bgedfa cbdefa
5+
ad dcafeb adcef feagc egdbaf aed cadb bgcedf cbeafgd cdfeb | dabc gabefd ecfdb ecgfbd
6+
badcgf gdaf gadbc ebfcg fceabd gacdbe gedfbac dbf df dfcgb | df adfg cbfgad fdb
7+
cfdb dca bdgca efgbad bafcgd fgdba cgdfea cd abdfegc bagec | agcbe adc dabcgf adc
8+
egdab gcefd ecbgd gdebcaf eacb cb bagcdf abgfde dcegab bdc | bc gedbc dcb fgdec
9+
gefa gedabf cfdbea bdfea bdegcfa dgbfa gfd gdcab fg fecbdg | fgd gf dbfage afbdec
10+
fagdb be abdfe agfebdc eab aefdcb acfed bdec fceadg afegcb | be aegcfb efbcag eb
11+
fdce fcadeg afegdb adceg cgafdb de ebcga dae cdagf abdfgce | efcd efacgd edfc afgcd
12+
gefc defca aefbd ec gfdceba dcabge fgcad cae fcadeg bagfdc | fgcad bdfea ebadgcf ce
13+
cdabe dcg cgef gc beadgf fegbd gcbde edgcfb gecfabd fdgcba | dcg deacb fdegab bdafgc
14+
aefc ebcdfa eabfgd deacb ac dac gdbce gfbadce fdeba gcfbda | adc afdbe aefc ecdafb
15+
eabfdg fdgba fac fc ebdac bfcg fcdabg bgdface bacdf fgedca | fdagcb cedba cf fc
16+
db dbg debag fcgdeb gfeba dagfec ceadg bdfecga deagcb acbd | gbdae afebg cfedgba ecdagb
17+
cabegd befcd aefdcb defbcag dgfb gd edg bfgecd gfdce eagfc | dbgacfe efcdg gd bdfagce
18+
abde fbecag gcabde cefdg bgedc bgcea bgd becgdaf gdcfba bd | baegc egbdc cedgf gdfec
19+
gedc eagbd bgadcef aebcdg dfbag eacfdb cabde fgecab ge aeg | gcbeda gabdfec dgecba gea
20+
afedgc deabf gbfceda fg cgdea dgf bdgfec edgaf ebacgd gafc | fgd gfac cbefgad cagde
21+
gfcbeda bfecda dgca ebgacd gbfae ecg gc gaebc cfgebd dbeca | dfcbea cegab cg cge
22+
adefc eabdf bcafeg bd edb fcbeadg dabegc fdbg baegf fgaebd | fcead fcdea fbgd ecdbga
23+
ac bedgc acdb gacbed bfgeadc degcfb aec cafdeg eagfb cegab | agecb gdbec abgcde agbef
24+
cfgbead cfgdeb gafb baecd bg cgdba bgc adcfbg agfecd dcagf | dgcefb bgaf fdbcgae agcdf
25+
agc dabc dcbgef efadgcb ebdgc baefg ac abgce ebdcag facdeg | ecbdgf ac afdgbec decfbg
26+
fgdcb cbdeaf eabfcg cefdb gcbeadf cdeg gc afbdg cfg ecdgbf | cg eafbcd dgec cbfdge
27+
da dbae fdaecb cdebgf afgced bedfc adf cbfeadg bdacf bfcag | dfbec egbdfc bdfca cefbd
28+
abgfced cf cfdbe geacfd bfac bdacfe gdebc bfedga dcf bdafe | bcfa dbfce cf egdbc
29+
dcagb feagbc dbef edafg fagebd bf fedgac fba bfagd dbcefga | fbdga dgafe cfabge fdbe
30+
gbfce bfc acgb fbgaec bc acfedbg gface cgefad bfacde defgb | cbgfe bgfeca gacb degacf
31+
cfgeda bac dbafg dbcfa bdfcage ecfb acedf cb ecfadb eacbgd | gafbd faced dacfb bcef
32+
fbgec eca cbag cfegba ac efacb bgcedf caegdbf fecgad fdbea | ca acgb ebdfa agcb
33+
acgbf cdabegf egbfd dc dacbef dacg gecabf fdc dbgfc dfcagb | dgabecf befgd acgd abgdefc
34+
dagbfc bc agcdf cgbd bfc ebfad dfcba befgac gaecdf becdgaf | cdgb dbcg abfcdg cfb
35+
bdcga ebdgca da cdeafg dac acfbg daeb cdbgef egbfcda bdegc | bcgad adgcbe fedacgb cegdb
36+
gacfeb aefbg fbaegd cedgfb dfcba gc cgae abcdegf gacbf gbc | cfabd debfgac cega egca
37+
abcfeg fdbegc ac bdafgec ebfad fcdae dcga fcged gdceaf ace | gbcfaed ebfda ac gefcab
38+
gefbc gdeacf cag ac acgebf ceab adebcfg bfcag cgbfed bgfad | cga cagdef gac fcgba
39+
gcbe gacfdbe dfgaeb bfecd ecdgfb dfcgae bef fcedg bcfad be | fadcb ebgc cbfda dfcab
40+
ebcgfd dafe adcfg gfacde cfabge bcadg dfc fd fbdaceg gefac | fceadbg fcgabe fade fbeacg
41+
fbacg cef cagebf gacefd ef bgced cfbeg dagcbf fbea cegfdab | eabf fce cdgeabf agefcb
42+
bca gcadbfe ca edca fbgade dcageb ecbgf egacb ebadg dgcfba | cgafbd feagdb gabecd cba
43+
fcebdg cgefb fagbce edcbg bfed eacbgfd cegda db bcd dfgcba | becdg cdbafg bedgfc cgbeafd
44+
fcadebg edbafc cgfda decba egab gcadb gb debgfc cgbdae gdb | bgd agbe eadcbf gdb
45+
cedfa gad ebcfda aedgc defagb gdafceb gebca dcfg dg edgacf | cdfg fadec gedac bcgae
46+
dafegbc dcfbae dce fcebgd egdaf ecadf dfcbag acbe ec cafbd | ced dce ce ec
47+
fegb ef bdcefg fabdgce efd fegdac cbdaf bcdef ecbdg acbedg | debgac edf ef dfacb
48+
afgedb caedbg egfba baecf efgdb gbcadef fagd age cfegdb ag | afbec degbafc fceab eagbdc
49+
cebd dfb dbecgaf gefcb afbegd bd fdcgb gfcebd cgdaf gfeacb | abecfg gacbfe cgfda bfceg
50+
acdfgb ecbga ba ecgdafb deafgc aedgc aedb aecgdb bag gfecb | cgaefd gabce cdgbae ab
51+
be fcgdae fcbag efdbcg ceb cfebg degb cdebfa fgdec gdcabfe | eb dfegc debg bce
52+
fdecg dafgebc fgcae fgd bcfd bcged edbgfc aecdgb fbgade df | afbdecg bgfaed fcged bgedaf
53+
cabd egdfa fbgac bcgafd ebdafgc bd eagbfc dgb fdabg cgbdef | bd bd dbg cbad
54+
fgecba bd dgcbea gfeda gdb geacb ecbd bfadcg efcabdg bgade | dgbae befgacd ecbag afcebg
55+
ga abefc afg fecadbg egfcbd dgfbac edgfac adbg fcgdb gbcfa | dbag fag fgdbcea dcbfeg
56+
geacf cadfe bfaced fg fcdgae fged ebagc cfg edbfgac bfdacg | afcbged efadc fg fcg
57+
cbd cdefbag cfadg bd bfdac abed fdabce dbegcf egabcf ecbfa | gcebdf faegcb ecdgbf fbeadcg
58+
fagcde cgdfa daef acgde ecgadb dbcgf fca eacgbf gcafbde fa | cdage cebfga adceg deafcgb
59+
feadgcb efcag dbfge edba dfcabg ebgfa ba gefbad ebgdcf bfa | abdefg daeb bfa fdgaecb
60+
dgfcea becdfg bdefg abgdfec beg cgedf eb decb bgefac fgdab | beg fedgc egfacd fcedg
61+
fcagbd adbfeg gbeda bgfde ebfcdg dfae gaceb gda ad fdbcaeg | agd gdeba fdgeab ebcga
62+
dbcefa bfaegd fdcb fdeca agceb fcabe cfaged beagdfc fab fb | edabgf gcabe adefbc fba
63+
eac cfgeab agdfc cdgbe gdbefc dabe gefdbca abcged ea agecd | baegdcf bfcegd gdbfce gfcebd
64+
cdbeaf cd dcf adcgfeb defab gbfca dgbafe cead fdcab bcefdg | dfcabe fcd dc cdfgeb
65+
gdcfbe bag dcebg dgabce cfgdba geacb bdea ba febcagd faegc | gcfea dgbfec fecag cefbgd
66+
ebfdgc baecdfg gabfe acbg bce dgabef cdeaf gfabce ecafb cb | eabcf gdfebc egfabc gafbed
67+
dbgacfe adgcf cedafb ecbad bdfe bf egcdab abfgec fab cbfad | bdfe fba bcfead abedc
68+
dca afdcb befagc gacedf dbecf cgfabd da dbag ceabfdg afbgc | da adgb gfedcba dabfcg
69+
fgcda bcgf cgfeda bfdcga gbd badfg cebafdg gcadeb bg dfbea | fcbg geacfd abfgcd bafgcde
70+
cf gacbfe feadcb cdgaeb fbcd fcdae efdag ecf gcabedf edacb | ecabgd gbcfaed gebcad efdac
71+
ae abcefdg faedbg agedf dgbfce gabcfe adfcg dfbge efa bdae | dcfebg fae agfdbe egfdba
72+
fegdcab dgcaf bfd fgdab edcgaf eadgb fbcg deacbf fb gbdcfa | acefdb gdcaf fcgda gabde
73+
ca cefa bgcfed facdbe dgbfeca adc dbacfg cabde edabg fcbde | dcbefa bedfc dfcgab dbfacg
74+
ce bgcedf cgdef gdabfe cabefd dec aegfdcb dgcfa gcbe fgbde | cegb dce aedbfc ce
75+
fcgaebd ef febdac feb cafbd edcfb fabecg acbdgf dfae ebgcd | feb bfe fegacb bafdec
76+
fgdec adcb dfbega afcgeb egcbd db bcaeg beagdc dbgfcae deb | bd egcdab fecdg bed
77+
ad dcaeg edcbag fgbdeac acd gcdfeb afegc ebda cadbfg dgbce | bfgadc dca ad cda
78+
bdegaf egfdb afb acbegdf fgdba af feda bcfgea fbdecg abgdc | fdegb fabecg degabf adgbef
79+
gdfbe gcf gbcda cadfbg cfdbg gceafb dfca badegc cf cedgbfa | fc fcg egcabfd bdcag
80+
fcbag ebdcgfa ce fgaced fbgeca gfbec cgdfba fbgde efc aecb | beac ce cgbfe bfegd
81+
dcgaef gedfb fegdabc eabfdg dgc cefgdb bafdc cg gecb gcdbf | debgcf gbcfd gbce baefgcd
82+
bfacdeg cedgf gfdbec eca edgcfa dbeaf ca fcdea dcebga cgfa | cefgd gcedfa bdfegc aefdc
83+
cdfea ebgdf ab adebfgc bdcegf gbda fab dagfeb ecgabf ebfad | defba cfdea ba ab
84+
gbefcd cbedf fcaed dgfb dacgbe ebfgca fb bfecadg cfb gcbde | eabgdc egcbdf dcgbef fb
85+
afgedb cabdefg afcdb efdgca ef abgde edf ebfad agdbec fegb | edagcfb cdfba efdagc dcebga
86+
dcfg afbgedc efgdb agbfe fde dgbce dabegc gdbfec df fadcbe | dbfeg gdfc efd faegb
87+
ebgdf acfge bae gbafe efdabc ba feadbg bgda gfebdc gedacfb | fbdcge dbag ab bafedc
88+
abedcg dcagfb cf dagbc afc fceabd fbcag dfcaebg dcgf abefg | afcdbg dcfabe fcabg adgcefb
89+
fdbc egabc bfegc fc gbfced aefbgd gfebd gfacde bgdafec fec | fbcd fedbg daefcg cef
90+
bgacde fegad febc gfacedb gebca gaebf bfa efbgca gfadcb fb | bf dcgfeba fdcgeab fb
91+
cgdfe fagec fbace afecdb acg fgcbead ga abfcge bcgdfa ebga | gabcef cfgde dfgcba gcbdfa
92+
bgae ae acegfdb dbfeg dbcgfe ebgafd dfcba cgefda adebf eda | aebfdgc bedaf feabd fbadc
93+
dfagcb cbdgea efabdcg ecdab gceaf daecbf df cdefa fad befd | afd gefca adgfcbe fd
94+
dcfeg acgf aec degfbc ca efbcgda fcdea gfdeac faedb cegdab | egcdaf gebdcf bdaegc aefdc
95+
cgebaf cbdagef cadgb efda degbaf fgbea dbe bgfdce edbag de | de feda dagbe agfcdbe
96+
eagbcfd eag efcad acefgb ag gadce fadg bdgec baefcd aefgcd | bgecd edcfab baecfg ga
97+
adbcfge eadfb faecd ab dba aebgdc ebdgf ecbfda fcba gdfaec | efcad febdg bfdgeca dba
98+
adgfc dfegc cdfeag edf dbecagf fdabge fbgce ed dcea cagdfb | agdfbe def efd deac
99+
cgb bfgde bdcfa fgcbd fgeadbc fcabed befcag cg dacg bgafcd | cg acfedgb bcagfe bdfagc
100+
fcbdge egdac acgfe efgcad fc cdaf gacefbd fcg faebg dcebag | ecdag efcgda fdac dgcbea
101+
dgabef fdabg bcdagef dcfbg fgac adfcbg fc gdbec cbf fedcba | bdcagf dfagb fabgd cf
102+
defc cgafed ecafbg fbdag aef cdgbae gecad facdgbe ef dgaef | fe fbecga gfdba adgebc
103+
gbdfac gcfbd dgceb bcgdfe fedabcg gdfe fbceag eg baced gec | gacfbe cdgebf cge cge
104+
acgdbe cfa gfba cfdab cbgadf cefdb bcfadeg fa fedgac agcbd | abfg agcbd gcfeabd dfcbe
105+
dagebf defcb dgecaf edfbac aecbdfg deacf be aceb bfdgc fbe | ebac dcfagbe feb bcae
106+
gbcfad fadgbce ag fdcegb gbda ceagfd agc cfdbg gfcba eabcf | dagbcf gdacfb dafcgeb eabfc
107+
dbgcea ag acg dbag aegcd bgdefca bdgce ebgfac cgbedf acefd | agecfb abdegc dgcefb agbd
108+
dgebfca cgdfa bgafe eda cgedfa dfage fgdbac ed ecbfda egdc | befgdac daefg acfdg acdebf
109+
fgadce dcb abgdefc cedgf fecdb cb dgcfbe bgdeca gcfb defab | fcegbd cb gdfce gfebcd
110+
cfbdgea ec dacgf fdeab adfec dbce dbegaf cfe deafbc ebfgca | ec decb ebagfd gcfaedb
111+
gd bcegad afdec dgbf efcdagb cdg fgdcba fgadc abfgc cgafbe | gacfb bdcgea fabcg gd
112+
dbega afebdg ca ecabdg deca cfgbae bca gebdfac gfcbd adgcb | cab caed abc cead
113+
cgdbfe ab fgade gefcab afcdebg agdbe dcbeg bdca abe cgabed | ba debgc gcefba cegdab
114+
cdfegb dbafe abdgce cbfgea bfg fg cgbed dfgc bfceagd dgbfe | gf fadgcbe aebgcf cafegb
115+
ecafb efgcab gbdecaf fbega egabd gef dfbcge fg dcbfae cafg | dcgfeb bafdceg agfbe gf
116+
efdcbg fgbca dcgbf dbfcag faebcd abegc afc egcdabf fadg fa | fa afc adefgbc fbcedg
117+
dfa gcdbeaf dgbafe gacfbe dcagb adcbfe febca df dbfac cefd | adgefbc daecfbg efbca bagefdc
118+
aec fecbgd aegdc fgcad bcedaf bdcge gbea defacgb ae acbgde | ae deacg edgcb afdecb
119+
cdab bedgf dcbegaf gdfac bc efabgc fbc cdbgf afgcbd efdagc | cfb fgebca cgfdab faedbcg
120+
ab eacbgf bdfa fcaedg fdebagc degba bcdeg afdgeb dgeaf gab | gfdbea afdb afdb gcebd
121+
acbed bfeacd aedgc aeg ag gdbfae egbadc bacg fcdeg gcdbfea | gdaec aefbcd gae bdaegcf
122+
fgadbc geafb dafbgec ecdb ce bcega deacgf egc geadbc cgdab | ecgba cdbe gacedf aecgb
123+
gbea eb cfdbaeg cebad gbdac fcdae dgebcf fcabgd adgbce ceb | dagecb ebc dagbc ebc
124+
fbeda ga aeg aebgd agfd bdgcfae fedgab dfeacb fbaceg begcd | ga ag afcbeg bfecad
125+
efabcg bdc fedgc adebgcf gcabed cfdbg dfba db cafgb bfcgda | dcb bdc agfbc afbegcd
126+
fbade bcagfe cgfea cdag dfc cfade begcfd cd gecbdaf dfceag | cgda gcda fcd dc
127+
dbcfa bg gafcde bdceafg gaecbf cbg bgde bcgad aegdc bceagd | gcdab eacgdf bg cgb
128+
ecfagd fbadcg fgbae bdgae gbf befc facgbe gecbfad fb eagcf | gabed fb egabfcd facbegd
129+
abef dcabf ecfdba afbcgde bgdfce af acf cagdb gaefdc bfcde | cfadb abef bcfde cgfdbe
130+
acedbf abcfdeg bdceag bgade acdfgb aeb bgdfe eacg ea gdabc | begda dfbge ae badcg
131+
fcda abgef da dea dacgeb fbdae cedfab bagfced ebcgfd cdfeb | bcedf edcbfg dbaceg bdcfe
132+
dgcfba cadeb agcdb aebfgc gdaf bcfdg gac ga fgebcad fdcebg | dgacbf ebdca egfdcb bcfdg
133+
afbedg egbd bfcdag edgcaf gbdcfae afegb fgdae gbf fcbea gb | dgbe edbg bg efdag
134+
acb abcfde fcgead efacd eabfc dbfa ab egfcb bedgac fdcaebg | defca acb caefd acbdge
135+
afcde dbe fbcaed aecbfgd bfec be eadbc afgdbe dacbg gcfead | be ecfb fgdabe aedgfb
136+
fdeacg cbgfa gefb bfc bf gbafce bdefac agefc aegcdbf agcdb | bf gceaf efbg bfcaeg
137+
fdce gacfb agbdec cgafd df caegd gdcefa bcgadef agfbde adf | fagbc fcgdea fd bfgca
138+
gdfacb aebcg ga dgae egfcbda cedbg dbegca acg gbedfc ecbfa | ga eagd eagd edgfbc
139+
cgbdf eb caged aegfcd egb badecg gdbce ecba egfdba dfbaecg | cagfdbe geb dgcefa dafegc
140+
cd gbecaf acfdb cdfg cda gbdface gfbac dgacfb bfade dgecab | dfcgaeb dc bgdacef bfacd
141+
geab fecdb gb feabcgd ebgcda gdcae gecdb gbc afegdc gbfdac | debcga bgdaec dceagb cbaged
142+
edgfcba agd bacd afcdg degbfc acefg efdgba bgadcf da gdfbc | gcfbd dbac cgfdb gecaf
143+
bfca fcbged dfgab cgbadf cdfabge degcab adfeg cgfbd ab bad | abcf afbc gafdb acfb
144+
gc fdgac fgeadb afdcb gecdfa gac gecafbd cabged gfce gaefd | ecbdgfa cag bgfeda eafgcd
145+
eagdc efdacbg cdgbe cbfdg egadfc egb aebc be gefabd dbecag | bafcgde beg gbacde dcbge
146+
ac afbgcd gfdba fabecgd ebdafg bac cfag adgcbe abcfd cfdeb | adbegf egacdb bac acb
147+
cafbed gf gfd cgdba eadfbcg gfdcb gbef cfdbe fdgeac gedbcf | facbegd cbdag fg fdg
148+
fbgcd fadb fcd fd dfcbga decabg egbcf gacdb fcgeda aecfdgb | bedcafg cgdbaf fabgdec dcbgf
149+
gb bcgeaf aebfcd cdefbga cbaef cgafb gbf dfacg gbcfed bega | bg bfacg bdfcge geba
150+
cadfe afbgced aedfcg cebfg aeb fdageb bfcade bfaec ab bcad | bacef bcafe bfgeda baefgd
151+
cgbde abcg cea dbegca ac agced befdgc bgafdec efgda badefc | cae eca gdfae dcega
152+
ab fgcbed agb cafge cegba deabfcg dbgec aedgbc gfadbe bdac | ab bdca cgfedb dgceb
153+
bfgadce cfadg fa cagdfb bcgdf fagbec gfa fbad bgcefd degca | fa ecgad gceabf dcfgb
154+
gfd dcabegf fg cefdg cbefgd gefb ebgdc egacbd gcafdb dcfae | ebfgdc cegdabf cbafged fdg
155+
dfecagb fbag bdcega gecdaf fg cgbad gfdacb fbcde fgd dfcgb | gfd gfd dgbeac fg
156+
gfaed gad feacg dfaebcg deba efgbdc gefbad ad agdfbc fbdge | dga bdae fegbcd dgfabc
157+
agdbc egdcafb caegdb afgdec cbadfg fdgba efdba bcgf gf fga | dfabg cagfdb eadbf cdfaeg
158+
bgefac fecdabg cebdaf de aedfb ade bcefa gcafed bcde adgbf | ebcgaf fbadg ead dea
159+
edbgc dcba egcfbad cfdage abfegd caged ebd bd gdaecb cgbef | cdebg badc edgbc ebcdg
160+
cgfabe dce fcdba efbcg bdcef bagfecd eabgcd ed ecgbdf dgfe | fdcgbae egfd edc bfegc
161+
fgecad gebda ebgcd egc dbecgf ce cbef cgdfb egacdfb agdbcf | edbfgc cdgbe edgfcb bcefgad
162+
geafcd cdage ec cdegbaf gec cgafeb abgcd gebfda gafed dcef | ce gdbfea egdabfc gec
163+
be abdgfc daecgfb bae dbfag gfdeba dbafe gbfeac egdb dfcae | bdge eba ecfgba gcaedbf
164+
bcge gbeadcf acg bfcdga bfcaeg cfaeg gc feabc bfaecd gedfa | bfeac begc fgdbca bgfedac
165+
gfbed ce ced fceabd dabegf bcdgef egcf becfagd gcdbe gcadb | ce ec bdfaceg cdeafgb
166+
gfdea db cfdgbe badc gbaec ebfagc bde dgbcae egbda cbgedfa | badegc cbeagdf bd egfbcad
167+
deabcg egbca agfdbc edagfb abe eb afbdceg efcag becd agcdb | bced eb be bea
168+
ebfgda bgade dbcea geaf gcbadf dgfba eg gcedabf geb cgfbed | edabg ebg cedgfb bgdcfa
169+
fc adgbecf fbcd abgfdc cgfab aedcfg dgcab gfeab cfg cbdgae | fcg badegcf bgdac fgc
170+
edg egbda dafbgec begc aedcb cadgeb eg eacdfg gafbd cebadf | dfgba bdegac cbge afdbec
171+
bgfecad gdbaf afdbeg egafcb db dba fdbace egafb gdeb dcgfa | fcbade fdagbe bad cdbefa
172+
bcgedf ecba bagcef beg cgafed eb gfedcab gfbad efgba egafc | bace fbgdec cbgefa beg
173+
dgfecb fcd edfbag bcfade fc caegd bcgedfa defab caefd cbaf | dbeafcg fc fabed dcf
174+
ceafg fbad cfeba edbca afebdc bf cegbad bcdfge cgdefab feb | gdbecf faebdgc dcaeb ebf
175+
cgdfba cdabf gfedca efgcadb baegfd bcfg fc caebd gdafb caf | cgfb dgcfab befgadc debgcfa
176+
ebfgca abcfe gca bagde bgcae dbgcfa efbadc gcef agefbcd cg | abegc cbfae acefbgd cag
177+
dfegac gedc bcdaef abgfd egf ge fagecb agefd fecdbga ecfda | gbafd dacbef gdefac gef
178+
feb begcdf fcab edcafb bf aefdc gbade bfead daegfc feagcbd | bcfeagd gcdbfe fbceda fb
179+
baefgcd fedcb cfbaed dgc abdgf bdfgc bcedgf gc gcfe aegdbc | ceafgbd fbcdge bgdface efbdgc
180+
fd gbdae bfda ebfgdc edf gfdea caegf aedgcfb fadgbe bcagde | abedg adegb efd fcaedgb
181+
befg gecdb dbcgafe adebcf dge ecfbd bcefdg aecgdf ge bgcda | bgfe gdebc dge ge
182+
cfdgb be aecfg gefdbc bgfec afbdgec cdabfe egbd cgabdf cbe | fbdgc eagcf eb faegc
183+
gfdbae aedcfg gbcfed bcde dbefgac gfacb ceg bdgfe ce efcbg | efcbg ce edcb ebgadf
184+
ba fecba dbcgfae gcab gfcade febdc adfegb fab aegfbc gcfae | adfgbce gebdaf cefba fba
185+
eadbf acfde cfdeab bagfcde bgfcae eab gafdce cedb dbgfa eb | bea fgeacd eb fegabc
186+
ecb baedc ec adbfgc cedf faedcb acdfb fdgaebc agbde aegcbf | fdce cbfdage bdacgf cedf
187+
fegc cefgdb fdbge bfg badgcf eabcdf fg begad dafgceb fedcb | bgf fdbec gf ebdacf
188+
gfecdab gbeac aebd be eacgd ebc dfegca cbagf agbdce bcdgfe | bec ecdga ecb gabec
189+
cb bcfg cgdfa adegfc bca aegdb afcebd gcdfab dbgca becfdag | bc badcgf bca fcbg
190+
gabdce dc fbgdc gbfec cfda fgadcb bafgd fbdeag abdcegf cdg | fcda adbfg cfgbead dgacfbe
191+
ecgab gbdecaf bcfa cdegbf eabgdf fgeabc ba egfcb gedca gba | fcbeg gacbfe ecdbafg deacg
192+
agc bgfca cg cgafdbe dcfg dcfagb fbdag cabef gdbace gdefab | dcfg agbfc bcfea cag
193+
cagb ga dfcga fdaebc fdebga cbdafg gfcbdea fcgde cfbad afg | cbga cedgf cdbfa afdbcge
194+
cafgdeb aebfd gfbeda ebcgdf agcbf egf decbaf egda abgfe ge | bgacf bdfea agfbe beadcf
195+
be agbefdc aedfgc gabfc adgfeb egb efdag afgbe deba bgfedc | fedgacb dcafge bdae ebad
196+
cfbae dcaegf cdbfaeg fcebga efgca cdfab ageb gcbfde ebc be | acfgde be be bcfagde
197+
bafdgce cea gdbcfe ae agecd agcdbe ebfcad agbe bcdeg fgadc | cebgad ecbgd cbdeg gaeb
198+
bgce agefcbd egbcfa eg fadgb bfcae dfbcae egfab gae fdcega | age gafcbe eacfbg gea
199+
fgacde gfaedb ebacf gc gdfc dcbeafg fadge gec bdcgea cgfea | fdagcbe gfdc aefgcbd gc
200+
gb acfdgb bga aedgf bafdg abdfecg gacfeb bgdc bfcad fcedba | fgaecbd dabcf bcdg bg

main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import (
88
)
99

1010
func main() {
11-
Day07()
11+
Day08()
12+
}
13+
14+
func Day08() {
15+
inputs := util.ReadStringsFromFile("./inputs/day08-display.txt")
16+
fmt.Println(submarine.DisplaySearch(inputs))
1217
}
1318

1419
func Day07() {

submarine/bingo_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func TestMultiBingo(t *testing.T) {
4040
t.Errorf("Expected %d got %d", 3, len(bingos))
4141
}
4242
}
43+
4344
func TestBingo(t *testing.T) {
4445
testInput := []string{
4546
"7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1",

submarine/display.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package submarine
2+
3+
import (
4+
"strings"
5+
)
6+
7+
func DisplaySearch(inputs []string) int {
8+
num := 0
9+
for _, v := range inputs {
10+
values := strings.Split(v, "|")
11+
// inputValue := values[0]
12+
outputValue := values[1]
13+
outputValues := strings.Split(outputValue, " ")
14+
15+
for _, v := range outputValues {
16+
if len(v) == 2 || len(v) == 3 || len(v) == 4 || len(v) == 7 {
17+
num++
18+
}
19+
}
20+
}
21+
22+
return num
23+
}

submarine/display_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package submarine
2+
3+
import (
4+
"testing"
5+
)
6+
7+
func TestDisplay(t *testing.T) {
8+
inputs := []string{
9+
"be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe",
10+
"edbfga begcd cbg gc gcadebf fbgde acbgfd abcde gfcbed gfec | fcgedb cgb dgebacf gc",
11+
"fgaebd cg bdaec gdafb agbcfd gdcbef bgcad gfac gcb cdgabef | cg cg fdcagb cbg",
12+
"fbegcd cbd adcefb dageb afcb bc aefdc ecdab fgdeca fcdbega | efabcd cedba gadfec cb",
13+
"aecbfdg fbg gf bafeg dbefa fcge gcbea fcaegb dgceab fcbdga | gecf egdcabf bgf bfgea",
14+
"fgeab ca afcebg bdacfeg cfaedg gcfdb baec bfadeg bafgc acf | gebdcfa ecba ca fadegcb",
15+
"dbcfg fgd bdegcaf fgec aegbdf ecdfab fbedc dacgb gdcebf gf | cefg dcbef fcge gbcadfe",
16+
"bdfegc cbegaf gecbf dfcage bdacg ed bedf ced adcbefg gebcd | ed bcgafe cdgba cbgef",
17+
"egadfb cdbfeg cegd fecab cgb gbdefca cg fgcdab egfdb bfceg | gbdfcae bgc cg cgb",
18+
"gcafb gcf dcaebfg ecagb gf abcdeg gaef cafbge fdbac fegbdc | fgae cfgab fg bagce",
19+
}
20+
21+
expected := 26
22+
got := DisplaySearch(inputs)
23+
if got != expected {
24+
t.Errorf("Expected %d, got %d", expected, got)
25+
}
26+
}

0 commit comments

Comments
 (0)