diff --git a/data/day6/input b/data/day6/input new file mode 100644 index 0000000..f3397a9 --- /dev/null +++ b/data/day6/input @@ -0,0 +1,2176 @@ +obegcmqadtrhui +qbgocuzeimrhdat +icuagdbztxrqehoy +cuietqhbfroagds +uqdgikwhrvcjeltbpao + +arke +qzr +plmgnr +uriq + +boqznasg +ozbncqasg +ofgpznjbaqst +bgszanoq + +srjykwuxvezbgdacmfltnhi +zuiedmknagswfcjxbltvyh +dcxsuhfrwzleatmnyjkbigv +zuesnjfkvclgmbwxdahyti +hvbndegywclpimuxotsajkzf + +zydkwetqav +wyqtmveadk + +o +noa +osub +oi +noda + +edtafusml +aorseuvlmtdf +deifpumkatls +eulstamfd +apftmsldkeu + +vxqgrpctomw +cwxtpvgqnr +qtcxvwgrp + +mukie +emkiu + +njvcbmxyquezgso +jsmcxnzdefq +dqcmeznjsfx +nejqzxmsc +hnqjscezxm + +uigvxyjnhwqrtbplmkdes +sykhpwtqmrglxbunivdej +simwetgbdqljynkvhrxup + +uonxe +xoue +unoex +mexoju + +v +v +v +v +v + +edw +ed + +cokqv +okqv +oqpxkv +vqako +odqhkv + +vdcuxbkiznw +uidxcbqwvknzs +cwukbdnixzv + +lzdhg +ivpkjao +ecwusfqbxyt + +owlzbmj +kmoabjwz + +obgwqplxrji +irqltbwxogjp +gbljwpoixqr +ljqwbogiprx +lobjgpxqwri + +gxvhbdwirntpocz +bzinahrwjmkdgtovp +viptgknqrhdycwboz +ogrhuislpevztwbnfd + +k +q + +kdq +dq +qd +dwq +dwq + +l +z +l + +pondj +jondp +npjdo +onjdp +ojdnp + +odjnevlh +jvhxebolmnd +vdjlheona +odhjvlne + +zxmq +qmzx +xzqm +qzxm + +lh +hpl +lh +lh + +sozm +ozsm + +uwjvbprdlfonyigszx +ygrnlzxufwobpskjvid +dforlwgxnijchpzsubyv +vnxszbijufyrowlkgdp + +h +h +h +a +ht + +exthuqmdfwaroniy +uwyjpqlnhkt + +rofyvgnpzejimck +znkvjefogcpm +ecvkzfgsotnpij +fjvhkepmnzogc +qwfglzakdxncoujpve + +oqwfbcdnipugkzret +turdpikfwonqezbcg +ktubceifdzownprqg +dryqbfungpwxckeavjiohtz +unbkqcweiprgztodf + +ezxnihou +mehixsouz +oikezuhxt +zdeofqacxihujwp +hoximuez + +akyuocenqgjplbr +eautkjrqpncylgoi +lecxopshdrykjfgqn +lzepogvkyrqnjc + +kwdtbgolvyiqmrc +kqhrcamedbgyw +ncimubgqdykrw + +canks +kc +kc +fbck + +dvrfgnocyewlqx +wqgyfsotvehinrac +oerycvwnqdfg +nowvdqfrygec +rcxnfowyveqg + +gh +phg +hg +uvheg + +lsmypivq +splymvqi +pvyimkzslq + +wmsbleh +wravbml +lmwbtvz + +znydtsk +tponsfdckyz +sxtdnkzy +tkdynzs +xktdnyzs + +muxeazdvhjwsyroqkc +xldjmwsnuoizyhtcvqrekab + +vnmakbhxeygiluqtzfjcr +acfexmuvjhknogzyirtbq + +mgqaijhcdsnvbueplyrx +ryslpdenvgujxhabqimc +aichqnmrypdseujvxgbl + +dbsvawikqzljmchgpfyern +fpmnbrajdszyliwqgevc +fwieycmbrajlsngpzdqv +edwifgybjmzqncsprval +oqygnpemwvfiazljcsbrd + +ldqn +lan + +lzyncpukrga +qfeuywam +azhycdu + +hgjrnubyc +gyhbrjcnu + +lrzjgwhkocadnxiftbqy +yqwbnatzkiocjgxlhfrd +jilqyxozcnbrgtwdhfka +ldatokrqhybifwgxzjnc + +kyrxqfuibhz +mkedonluwgvcjas + +tmlsrzhby +yzwmrlhtbs +trvsbzhylm +aylihjrzmsbt +zbthlmsryw + +fhmorgvqbzpyiscja +jpvrgmqiuyhlzckos +ohjmzgpbsvyircq +brvhmzqgypciosj +dsyfvcgjhzirqpmo + +bsazqjtfegurvwihdy +fclaxtjngbdvpsoukr + +e +e +e +v + +ep +pne + +akrplevwnz +zdrakolycfnw + +hmrgxjyneavlcwbu +newaymbhuvgljcrx +yurlxnbjamvwchsged +gbnrwexvculahjyipm +jahnbyrwlxdmvceug + +zoianfdevtg +rdpgukevtznia +dzyagteimvsn + +giuncjmwzvbayto +ykmszowb +wzeyxbqom +qpzmybdklfoxwr + +znvdpaotegisfbjm +vceupwrmbakfolxdtsqgiz +nbtgpfhsiomdezav +iosepvgfzbdmta +vtzpeosbyamigdf + +rsfwj +frswj +jfsrw +rsfjw +jwfrs + +zubhjkg +bwhuagvzyr +gyuzbhe +tbxmnhgpqoscufz + +ohjqacykpvmrilwdg +goyqrhavlpcimkwjd +myhdjlvrcaqwiopkg +hdrvjimkcqogwaylp + +yirmagdhuvtzkle +glvehtramyzuki +evrikhltmgzuya +muezrhikvcyglta +mezyuvlihrktag + +wluevqjznxocsd +zcuhvjoqlxe +zuoxecqvjl + +pjmichseugal +mgztiudxslqcoarhef +cngaesihlmu +ubmpcklgeisnyha + +qhbsti +istqbh +qbstih +bsithq + +xk +k +k + +efmwzdnrhqgtiyvk +nyzgwfqtmrehkivd +nwydvjgruqhtzkfmie +vthrqykgwemzdfni +fkreadmhwtvgyiznq + +o +j + +ze +e +e +nex +egfm + +j +j +j + +idxcmetunkwslrza +gamsozleikrwtd +tmderskzawil + +dyjxvobnkqahug +wftmu +ipu +cfmwlsu +zepums + +fpglquhvkm +bzfdnyipwe + +xoevwyscith +pqybhdxc +kfnalcxr +emjuchx + +ypcxsvkaw +avhpys +apvsy + +teqxvcubirsomkhlawjyf +vftxuiyeqcjolhmawkrb +ijarmqwfhvoyxcultkeb + +zymvxowikndtghlcjusfrp +dqinpvbheyajmousglrtxwzc + +upwjeicvf +vfcbjwuipe +ivpecuwfj +pifjuwvce +cijvuwfpe + +eb +be +eb +eb + +jhqns +njh +hnjc + +jy +oy + +ufa +auf +auf +afu +uaf + +clbjzprytinows +lwonizrpjstb +tprbojwsinlz +gtjszplobwrnim + +cfhprvykoqmwljbin +qrjcpikmnbohy +jsrcnmiqkyhabpo +opqcehixbdnkjrmy + +dcxfolrbvkwtmyaupszge +zeartxugkvpwflmbsdcoy +zpbeuldxktovfargsncmwy + +famkjlsheuqwbdxngozvi +yakiqfhmzegsxldovwjnbu +xgspwdmijaofqlnkhbzeuv +gekxfmdruzilohnabcqvsjw + +k +kz + +uajnk +hkojnxar +jnak +dusafjkn + +otxlzikapesydbcrfwhqun +pbkrsanixeltfhyqzoudwc +nlzhaxdrupfibestcwokyq +euzxhbysdqapwmolnfkictr + +pvqgarhxdjzbtsyimen +bdretgxpjvynhqsmai + +fgwrchmjnxiopv +nlucbvxghfow +zqcaxnyfovs + +hblteankugvyxpdsr +srkbuvynghatxdpel +rtphbausklndgevyx + +eiskhzwdjoyn +mpqutdva + +xpwfjnthiskv +inhfvwpxkstj +xwvhijstfnpk +wjskfpxhntiv + +sjprnbelik +bekpioryjl +ibekjprzl +qsjipdlrbek +lhkejmxiwrptb + +sqawfcrhyzpgjuxvti +atlqrijscpfkdyzmnwxvge + +vardxqmcwzijn +mvgrbiajnwcx +wnrxuacvjmpi +xrjmnbapvcwi +vmrgnxijcaw + +ielvwpqazu +wepzviualq +wieulsaqzpv + +j +j + +awgkl +awocgkv +fawgks +fkgauwj +akwgu + +gkcpnltfvohbderiu +tkbizdjxafocpvgeru + +opl +jxkcey + +d +d +d +de +d + +czxs +scxz +szcx +xcsz + +yuckwfreoznjhai +zkcnwiaefhojyu +uykofwhezcnija +ahkujcoziynbwef + +zdgcqnojsvibkep +kedjcinsqvzbpo +isdopjuknvezqbc + +ehi +ehiw +ehi +ezih + +thqcvwnliu +cmykgiazwfqhl + +kpor +qorhp +pvfr +ayrpdb + +tihnwgvblmozjcef +rvmhtgjsdlbwcfaoinp + +ihztv +hty + +bucjsefdxy +fxdcbyu +ycpxfuarbkzlhv +qfcuyxwbt +xdybjcfu + +lukmjhqgdrnsczyotape +jgkwsptrdhocenyamzu +ytjkrezmapoduncgsh +jbtromsyhkezgaudpcn +skyrcgmdnuohapzwjte + +vs +qvsyd +sv + +xkfliuzvwrncqejgt +xkfqzigrwunmhvlt +wjvqifzltgnucodkrx +trfwnzoikyqsuvgxl +dluwikxqztfrngcv + +plf +hflpzqyj +rlfap +fptl +lpsf + +atyj +yjzat +htsjgay +yjaft + +abwu +locvqdupj +uoiqgjcy + +kvtlociyjfdqmaue +qckovdufmaityjle +vtqdaljymicekfuo +mfveyktuaqlcdoji + +s +gocnwlyshkuv +jszmx +dsqzm +spa + +z +q +z +g + +seymr +smr +hsqmarcx + +w +t +e +r +er + +jcsf +ivtzmqy +j +fpc +xs + +dgrzptwnkucilas +lwkhcgatznprj + +hsrl +hroewls +zsglrh + +jbxqrlpcnfhoimzawvysteku +rpxytswcqfvuhlbimkazenoj +yowmvhiekgfubdrqanpltcxsjz + +iv +vgi +ivx +zvsj + +xcbvdosph +dqvohacbxgty +hoxwdrscvzb + +typnodefzigcrvu +hlwmcsaxbj + +whqtmfru +rhwyumtfq +bhuftmjwqr +twqrumhfx +fmwuqrhtp + +bzqfsv +zbvfsq +fbzrvqs +sqbvzf +fsqvbz + +rdaslwe +agwdxln + +bcrtsxuha +zgrjblachsm + +uzvpx +zrxvp + +xhlfkneturja +nhlgtjxeka + +pvxhqirmkoyadgbte +kamqxihdtprgeb + +enubxywvptfgqjc +gjydubxfeqpcntvw + +teyg +yge +ygem +gyet + +rdinjqykcaphu +gkldmqjyo + +su +su +us +us + +lyovuimrewjgs +arkzthbdqcwm + +pfvzikeadrgsjlbo +zflpdkbsvjgae + +rkuybigaldcf +diarkycfub +dbcyfirauk + +shrjclfmivtb +ehtjwirsu + +ifotmzhw +otiwzmh +iwmzot +zomyviwt + +seiko +heqt + +gvwzfrtbnldmqcask +vgnkcalzftdsqwm +claqkwtvsznmfdbg +malfkzwtvqnpdgesc +wsdfqlnvgtmcakz + +qgejmf +vflkm +mteqfwy +fgejwmh +xfm + +heicjvgfoltpk +evxdsbnikuaoh +iheyowvk + +egmlqr +emkglqr +ngmqjlre + +va +yv +v +ova + +a +g +g +g + +s +skjy +s +hs + +hzrkgjwdqicpfyaemxln +ykincwxbghdajpqle +uihgtdpnxwcyeljr +xhipnvedlsycwgoj + +hdgubnvtk +asjbxhnil + +xmw +wmx +wmx +xmw +wmx + +sixpuvcwqnjyo +ndrfhkvetplgab + +ed +leg + +zohupvtgxyqbacrjil +hvzyugqobjlxrpcta +zvolpibwtcyujqghxar +pcqxugzmayjotbhrvl +futbyprshnxqvcjdozgla + +uojswtaphezlnfgx +ptezjwgsuahyox + +k +k +k +l +k + +upwxhriavm +zgsljdctefbk +qdlktyfons + +gtfbjreyqkodxzmivws +wtsqvlgzenpdckxaj + +ydmqlajibecgtk +chygtmdjxbiqkl +lqgibcjkytdm +bmljyigckqtdx +lqbcgtdjmyik + +xhlscr +rxhgl +lrxy +nbzxrdilmkp +xraolye + +xtpo +oxtjp +opxt +fxpot +xotp + +hifbvjuylzkme +vehalfuikjybz +lkzhbfjviuey +buyekjhzlivf +fivlykebuhjza + +lthkmdayzbgjwfoiurpnx +mokjinerubtzqayfxpdwhslc +vjglrknuopahfmwydxztbi +okxhnijadmtfrbuywpzl + +qzw +zq +qz +zq +zq + +zexdklupcyhriwvf +fjngasdbxtpzqmoyuev + +dmrtznach +rxnmda + +zghy +hgzy + +a +a +a +a +ja + +cbqhk +kcuq +pkjcxiq +iqcprk +tkcq + +iryfbjmovadlg +oylrgckbtm +zyxgpbemqsnhol + +pmuxtrsoiglyqvbe +bquysmtlxeroivp +isqrtluvmbyoxpe +uxmylrtpsevzqiob +qbmrsluxoiyptvze + +gqxucskpmrtidyfboal +humofzyblsxgvjknawc +xbajkesolufycmg + +kvxmbu +xkubv +xfvhlkb + +imaqkytjpzou +potumqjzikay +koupazymtijq +ztapkuiymjqo + +yjdbhamkeixgvlrqnc +hikwzblxgrnjevmdcqa +leqkidjnxvcahbygmr + +e +e +es + +b +p + +moieqpsndljgrxu +ndielbuvms +dfcyilnetsmu +wibmudzlanes + +cbs +cs +sc + +msofaty +atfqyomks +syhtoafm +tymefsoa + +mecrv +zypemf +imedn +khmelc +oemhgs + +vsyltho +syvdt +cqyvis +vufys +ustmpyv + +estzgja +magdkbjs +wagstj + +yhutnefprqi +ruezyqtp +bqeyvmcwrtusapd +xtqrypeu +uytqrlep + +tngbaijord +tdgbioarjn +bnaijdrgto +ojtbdagnir + +kmwiqybrnaefzdgocxul +fzarxdicokquygnebw +peawsbtniuzfqodhxgcyrk + +bngkczupvelsat +fvaetplbszgk +plekstzvabg + +eircuhv +hurvice +grhufcvei +hirevuc + +dptbhacwq +dbqpwcath +acqpdhtwb +dsqcbawtph +ahdcpqwtb + +jsoudagiekbtmn +gtunoesbmd +osgdtnpbeum +sgoubedtmn + +vadpkqoh +ndqpzahkv + +ikcxjwvobmslqnzuht +uevzocqmfnw +ouwrczqmvn + +a +a +o + +hautdzqwyxefvcklns +wfxtyvesqzuhknldac +sxlzwcehadifkynqtuv + +u +u +wqe + +yhin +niyh +hiy +hxiyvg + +qokxgbfemphyzisrnu +rehfjypgwzqvaosmx +dqwsghfelzyprmcxo + +xeksbaphnclzfi +klenzhapfjsx +szjlhxgdaeknpf +fnzkpsejvxlha + +auvobisz +zvibuo +bonzuvi +uobivpz + +gtajlbxrkyw +mxjntlrz + +tqov +qvot +otvq +tqvo +oqvt + +eofmhxqarvkwizpld +rimwhzeauxlkdvopfq +ovifkxaqrmeyhwldpz +pwirlxvaedokmqhzf + +hvscaetpdzfm +zaehmtvfdpc +mzfevhptadc +emhfdaptzvc + +onmzyr +xms +emas +mbi + +gqnkauwvc +pwven + +lvpiancg +qkd + +coyblen +fvbjcupmigk +xrsbyadec + +kwrvxpze +rkzpvb + +lgwe +lesw + +hncvjkmsqygtiuxarzp +qyzjxarigokwsucntvph +juvkqxaricznphgyst +pxhvznrkitcuysagdbjq + +qwpjefm +lsbhr +xz + +gisjrzuwqvxmtnbhf +jtsvwgzqridxfmhuoab +tpgxmdzrswjylifbhqcuv + +oxe +q +q +m + +eorcvyjdq +muqpizcaxfwrgyb +tkyholrqcs + +yaethzk +zeiaty +tbyqnawlpme +eyatvo + +fpd +d +d +sd + +otbzugk +tbuio +otbui +uotbi + +bsapxrikhuqycwfomjdletzvg +fqehjmosxudvrbzpyglatw +wvloqymxtufrpagzbhdsej + +ayxdqzkbipcewmnvlf +xkdmzwtrpanfivcl +kpzlixfawvcmnd + +dj +ilam +b + +pgdujfea +dl +wd +d +dl + +miblonqsaczex +oeilmxqncsbzavk + +sdktqoerclumihwjpxgfz +nokympdfbjxrztuwcilveqsg +wzgxlijndmsueqfcorktp + +bpoy +opbdy +ywpbo +ozefrbpy + +abl +qalfk +hctial +faljyx + +t +rt +at +t +t + +iwgohvufqpnbk +gwzphnaxcbtfqsuo +hewnufqbogp +qhpuowbngf +uyfbohwqpkng + +evgnrzk +xingw + +jwiokvzdxeaugrq +ufrqbdkijewaolv +uyqjdiloeakrvw +iwjudraqevomkh +eavwqkrdilcujo + +qylurvpjizfnowtaxgck +gdfmwaviqjxploucznktry +gpwfuxqlnjtaozycrdv +tqauervyjncfbopzgwlx +xwlvyuzgarqtfpnkjco + +t +t +e +pz + +xcl +hax +xue +inlyxu + +gxz +xkmt + +fmaykdhqlptbn +gwyhpxstmnzbe +hltmynrjvpb + +ckmx +cxrk +ngqzcklfbx +krdxc +ckx + +valqsuznprwdtkjxc +qzacupslkwfxntrjdv + +lrgufywvkda +vafdulkwryg +uykgrfvwlda +uflwdgkvyar +fsnbugvkdwtyral + +bwnvsmkz +yhblegsr + +qpogvdsy +phzqimywsf +ysdqjzo +sencrxtbyk + +jtezkqlphbwyrmu +blwjhqopuymzrket +qzlhwmkpbruejyt + +mvyarwjzd +qzrajwy +xtryzbawgen +vrpazywd + +tun +nut +tun +unt +tun + +sjqyvcfrpewhkzdui +xdnmhjlot + +bhiktrspwlofcdexgzjm +tqdscwpnlugfrhkzeiox + +xylvi +lxyicuhv +ivylx +ilyxv +yilvx + +pqguyfrhjob +jfbgrnoptuhv +wjsbhodfpgzxur +fejrcuhoglpb +ujogphrfb + +evxfqkyl +qxevjkl +vsxqknl +lvoqzmdxckibwgp +ayuxqvkl + +rozu +our +ruvwj + +dncwgzom +cw +cwu +cw +kqwc + +kxz +xzkq +zkx + +saehqwxlfgnudypk +kfqipbuxwaonhsyl + +bhkcfume +vrmetubhjcif +bmhuefc +zemluchkbf + +uzyltpa +rbjvxskewd +pzhgtcon +f +niz + +u +c +cn +qhk +n + +ovgehisbcr +besrgvoc +rgeosvbc +rqcbesgov + +ktl +sm + +hvczbfyldajomw +aytbzdnocmufwv + +d +la +d +v +q + +jhwsglxoniqpz +newhojxflgysqip + +k +lkp +ki + +odnfkmubqgxr +tjauoqfkrycngxd +unkgsxwrfqdo + +crmkqntouf +kuconrtfqm +utcnrqmkof + +zy +wizybcg +zy + +optdsiwyj +nwtpsfqydli + +vumaih +uivgqh +lvudchrkie + +arxiblucpw +wilxubrpatc +rpuiabwclxo +cpbiwrxlua + +onpuwraq +nrqdowuap +wournapq +rownuaqp +arnowupq + +oxvid +dvox +dovx +vdxo +dxvo + +apnfeix +ipfxnae +ainepxsf +eafxnip + +hwgal +gdynu + +kyvxmesfncuilqagtb +nbiclxkztafev +ickfxltvnebha +edikvfcltanbx +evbflntpcakix + +xy +y +ycowzf +y +yl + +qeaklh +qlkhea +hlaeqk + +tbfqjudrpeixm +fbglujtprqmhvdzkxn +tbdrufmipxjq +rjdtfxpbueymq +bdjmfrxpqtu + +tvmbsk +caywezhboqgnx + +zi +fiz +vfiz +iz +yqiz + +nwot +tnw +tnw + +enaochix +dewsplq + +xyhtqafdgescijpulvzmbwo +fowagctbjmphezqvuxsyild +aewojmsyczlhqxbuvfgidtp +etiwxvqypomjrfhcgadzslub + +cntkbsilqyjgpzm +bgslijntmkcaqzy +bgstkzucnilmrqj +itfcnhkpdjasqmbzlg + +gjxirvazbkcwfouysmdn +vkwpbrsamxuicjtgyodlze +ibkwrmvxozysupadcgj +rtsowkzjacxmediuybhvg + +rxahlpwjfotidy +dawojfrltiu +weptardbjlfsoi + +m +m + +oh +qy + +qhj +hde +h +hmj + +cgtqxjroh +jcrgqxotd + +boj +jbo +bjo +job +sojb + +pouxz +xzukao +fen + +t +t +t +o + +q +aiqz +q +cqhl +keq + +ajqyp +tkoqazlcnbviuxy +aryqh +pqya +qgya + +vojnhfbi +ojcfyh +dktlxjohega + +djbxhscvlawi +xsdwavcibhljk +hwjsvidamxcbl +jdbwxsialchv + +kav +vka +vak +kfcva +kav + +zuohp +houp + +fg +s +ycnvbtw +ro +or + +c +c +dh + +w +a +bl + +yfzohi +fhiyoz +zeifyoh +nfiohzy + +wyqprkdoeainh +idypnoreqmwkh +qkroidhepwny + +uax +zqbfa +zatrl + +rkuoh +hr + +yezkracmbjfnxsvliguqowt +ujlszbyxqcgnrvotmkifwea + +pen +ne +en +mshgbcrwqtnke + +gomhicaner +kvqnfpldhomxyz +nmijoh + +atjucifnlzkdwgyph +ncfiptykjlzgdauhw +ztchugdlknpywfaji +tfgpiyhazldcunkwj + +fogcmrluvbjiqhwsxepd +qmeucloxiprfsjwhgdv +poefrdmizwgjqxsuc +fkeugpdsmynjxociwrq + +sx +c +c +z +mc + +nmcb +kpfyoba + +ngdarukiejsx +vkgjuinbrhdeosax +uaikyjrqestlpxngd +ejwniuscxgkrda +grenjaxudisk + +aevkuwzs +wuvsazkqge +vayezsuk +zkevgsawu + +zijmanpyewl +broqskhv +xtfkudcg + +fqsjpzc +fpzjcs +zpcfsj +jpzefsc + +khpwnod +tyvu + +y +y +yw + +hzxowsryablmgudi +knecgxtsjpq + +yaqjv +vjaqy +jqvay +vjyqa +qajyv + +dlbgapxwryonfkmuchtsj +ghxzwabfstclnkyjurop +wpjhatslgfryxcknbvu +ajilxprsycutqbnfhgwk +zbmlfxcusyajdrhkpgowtnv + +wfxqtlk +wxqftk +qxjkwt +jqtwxk +dqkhtawxn + +cu +cu +cuew + +jcxuhafrbvkzw +axfrjuwplh +wrhdtqgasufnj + +wgyrb +bgywr +bydrgw +yrgewb + +lxeditmnkyr +hriznamtekxly + +kj +mlw +x +wl + +cqzat +qca +acnq +cqan +qac + +lnhcwrumivsd +rdcmsvhlinwu +vmlwhruoncsid +rscwvnulhidme + +fkmtxby +xjmywkfbr +fbemxyki +bmflkycx + +s +rksam +amsr +jsbp + +raoqwznuk +obyrutqkzawvn +anjwrqhuykzo +owqlnmrkzgaudf + +ydpe +rhygldpuq +jfyodtaxpsmw +zpydbni + +xudow +vlcjkmyoaqzid +nxurdo +donfxu +dpfxseo + +mvzqxgenwfkc +qkzwgfnvme +gfwdqvnkzme + +ywjbxsfdmona +oxawjysnfdm +nsjdmafyxbw +yfjanmwxsrd + +haynzevrkoumtip +jkvchaitymgsoqxu + +urdiqvlsxcohagef +qpsauenjorkwxi +yhirsoadxbqeuc + +p +sn +p +p + +jahbpofqukrlgse +fhrjgceasdy +xzfjvestahngrdc +wihgfesjanr +gefshajmrz + +itgeawlsdfpcon +getwnlofszcpa + +oetkdwyrifnlq +azhgcvbuxjmps + +ycfwbvjmqpudrtlzi +azgtpyjubcfimndrq +ojcyirptufdmzqb + +edkhqcyfjtizs +ykfvtqwspmnjzighd + +gqr +r +d +ujf + +jezrntd +tjndzer +ntreudjz +nrdezjt +njtredz + +zvtqunpsrewmxcagbohlkfyijd +bzteyksicxphlunjgomrdqavfw + +ejqlkasdzboityhu +lejtdpuoskhzbqxi +kbtjzyihqseolud +kshzqojrnbedulvtmci + +vcqoinhefwspkmaxl +ehoxgmvbwlputrfncaq +vwamxhpzqfnelco +qhpwmlfvdoenxkca +qhxmvcoaflepwn + +kirjh +irakjh +rhjik +hkrji + +hlbcemokurvxft +eofxkhmcvlutr +xucfotkvmlyher +fumenovrhlkctxb + +rishbgovypejfxtkzna +pzihsucerqygvl + +euozbtvrhm +qzxcgjdk + +ji +j +wl +i +q + +xsnkuihpdbozjqgaetcy +tdsyxnboqukacepihjgz +tkwaxdouzgyjbeisncphq +jxnchpyiosqeaubkgtzd + +qjvthdciaflyweokzrg +dgeyjtfvchrlwa +tylvcedrwahfjg +etdhwrajlcgvfy + +hqwkavzcxng +ehaxbfntwroikm +dlnxhwkza + +owaj +jcko + +bms +bm + +npilzedmafwvrt +dpmwftzavlgxiqrne +vdeuralfnkjzmiwpt + +qo +oq + +lpe +lpe +apevl + +f +d + +wogseatpdvqy +zbmrtpxgknulh +ewtfgjp + +hkpbd +jkrhv +ktmhscxlyz +fkrhb +whqorkb + +urdw +tuwjm +urwz +yuw +suwfh + +gvlxdaib +vjabqxdlgk +gxybaldv +egaxmvbdl + +xjmyfunivklc +vnuchxlkmjfi + +jqlyw +ylwut + +svfpjokan +ocnfksjapv +ytozqeidvafpkgjsn +jkxfrscavnpoh +kvnfjpahos + +jzcwlfbogmsdkaevi +jgsacbliezqfvomwkd + +gbmr +gm +gom +zgmu +gm + +ubljomy +uybmjorl +yloujbimf + +ilvzgshjcko +shoilgjk +jhosklgi +jkhoisylg +klihjogs + +fkwn +wkf + +wxdhuf +xbnmjlrsytez + +eshlq +wnkjbsqoi +ldmcgqurs +avxsqz +txpfaqsmy + +csyfboinlwe +verzxw +pezmwh +ewj + +mfl +mn +mxpn +m +m + +isf +isf +sfmi +gsif +ncfaisb + +uokthaqjvisrnyme +pomhrysveatqnuikj +qtrsjkyonheviamu +hvoqraeisnmjtyku +esqhuvnoamiykrtj + +hwvuezyplrqxdmso +rqulvhsdxfewpjmyo +pwmbyvudsrxcqnoklgh +fqaprsvywhmulxod + +orcaqude +sdyu +udl +sdu + +sdi +kdzis +hebuns +ys +syitvzk + +niwkqodtcrpe +rzhpiwdovkc +zoikcwrdpf + +aqpn +nqa +nqa +wnaq + +lkvjdxmfgtryuzb +tubdkymzvlxgfjr +tyzxrgblumjdvfk +zxrtlmkujvfbygd +vyjkxfgrztmbpdul + +kp +pk +kpn +pk +kp + +vjbg +wunrzhvjlykcsg +vjeg +vgdj +tjbvig + +y +y +y +y +y + +cjxeu +eucxj +ecujx +xjcue +cjxue + +m +m +u +m +m + +sahrtgbnivdoe +koidnhfeugyvas + +jaqlcfu +oztg +vterkhp + +nbxwcst +bmqntwxse +jebtwxsqmn + +bzwjxoaq +quxbfzajw +atscqwxjz + +bvu +esdjkf +rm + +mnspreiwdjqkftohu +urmpehjnwxvsdktfoq +nrqemjwphkutodfs + +xwuknmizvoafcerqhj +nosjwyzahegfik + +dlyj +jdq +udpjr +jlzd +jd + +vtfphlmkniawcex +vzwkhacifnxptlme +lfikanhpxmvctwy +mctvlwfknprxahqi + +kielm +yswgfxpkb +lmtedokh +tzonvqjka + +touiracgwnqehmbvpyd +qlfdcgpryzskxhjt + +fpwryli +ilwpryf +frwlipy + +aojegiwzvyfbx +evoxzygafjwbi +bzeogywjcvxfai +izjogaxvwfceb +ezjwiubxfgnavqmo + +kscztyfrgi +drqfcs +jmhnevaxrlp + +vmblxpyuorfq +viprbouymfxlq +fpobylmxuvrq + +xweiukthcjzdvr +nmfbgylhwakrq + +tuqkgzp +qgtzjkp +zjkqptg + +mbldpuxkezahf +hkpfzlbumxdae +bemxaklduphfz +fbkzhpaelumxd + +vs +mvsq +szhv +xjvshc + +bodkn +ehkbdv + +mnzuqa +codilpaby +awukng + +n +n +n +n + +pxbhwckytlv +wvkclyxeithp +ktybhwvcpxl +bkptwvlychx +khvlxtcywp + +beczgduqh +gudhzqe +qzeuhdg +pdhgzueq + +hvcxlngijzkqr +gnkqvpilhzdx +khxzqvdngploi +hzivwsnqxgkle +livxgkzhnuq + +jwhufepin +vixycrtsua +eoqbmiu +fpqui + +wr +wr +rw +wr + +dxsbrce +ivfrdspyc +mcxzrdsea +cbrmds +crds + +owedcyqix +eocwiqxdy +hicodqxymwev +qcweidyxo +ejdwqoxciy + +qeijgvszpdft +txsjyzipqgvfne + +ukictp +umsfpnic +brvzlgxoheucap + +ybdu +m +pd +cgwr + +rmaojwdfkulzsictxvehbq +idfwahsmrecjolbxvqtukz +sxvicwbaudtzekhqljmrof + +kewjqgnaoyizu +ygqkxejzitnuaop +nukoeazgyqij +gzjqlnuieokya +qnyugcojkeiza + +dctjbhpsqxofawnl +tljhdapboxqsfnc + +jqelifprvntodmbyz +pbtornfqvglkdey + +gq +qlgn +dqg +qghdy +wqg + +sxzfwoahiljrbvukqytpm +tfrlsjcvyzwkbpqmahx +sxrmwqayhlbtpzfkvj +tjywxfmlazhkvbprsq +vfbxryhgwszptklmqja + +zvdylkifjb +gdvkhcfzybjn +fjdynkbzhv + +tupnrivwjghcqf +vfmqwuokdabgseh + +ufhjyxznedlpr +hzldxeynkjf + +pngacuzedrmkvy +vkgjensmycrua +caurengzmvykd + +gq +l +l +i +p + +kpdnmf +dpnfmwk +fenjxpdqm + +rgc +kyj +mhk + +ajskowgdhfzenyubtclr +zrdjebhlovcuwstnga +mguajdnbrohslwctezq +oiecblhjzgwyasnrutd + +ebmntqlhvriof +qphonetbrguzdvcflma +sbvnltehqmofr +qtrbehlfjonkvms + +jnveyrixtkhqgawpuz +pkvzxunifwhtqgymer +ziuqpthndxlkervgyw +wsiqcvtyrnzkheugxp + +sbucfoavmxgnjiq +hjavnsblowqu +vjnsbuaqok +oasbjuezvqn + +vubdcqhmia +hsxuqzibvanmjed +qciwdabhuvmp + +knqedza +uakyol +jgvfpxibmrsc + +m +m +m +m +m + +nz +h +n +o + +z +a +z + +diyfo +od +do +do + +mlvtparjzqknseu +suyrzpmxenakj +eamxzkpursnj + +ihvq +qihjdv +hqiv +sqhvi +hvqi + +eitp +evji + +gcq +gqc + +agziqmcso +ngaobpmiz +masigzo + +klmgirjonfvyaqwuhzxtpsbdec +vejwyfqcudmraizhxontsgbp +virufxmenyphjacbgwdstqoz +bhapvumjrqosyfgziexwcdnt + +h +qtad +c + +hxlnkmop + +cyshewoa +zdsech +sxvecth +sehc + +wtghsjpa +awsjhtgfp +agtpjwsxh + +zlqph +lhqpz +lqzhp +lcpzqh +qplzh + +jdcqwmyfuilr +rmwfjiuytlqcd +wcidluyrmvqjf +iwqfjmulyrcd + +tqepgvliz +elgvqpz +zqpegcvln +ezupgqlv +lvqpengzs + +jrlqxdzvyw +gtjdyqzcwx +jmkqwxeihodnu +djbwqtx +rqgjwvxzyd + +khmnqvptdeuxyif +zcgjowsdpxalvbrut + +lujwhxqakodmg +luhjokazftdxgvwq +khlegqdauoxj +ahxjkgqudlo +juxkanqcyhdorgl + +ahz +zha +haz + +yaodktrq +tzdpckoan + +gstclfpkmo +agctslekfp + +hi +w + +rfgnkboymhltsaujcix +rufaniyxtmglbchpoj +bhonfylimcrdjtuagx +gmhjfanubyxtilcorv + +bzmctlexkswj +mwlkasxfbze + +dqpnelfgymboxrctuwzji +njqywifxrplgedmoztu +olxqejuafvwgzinmpyrtd +ynoejwxpzifrlgaqmudt + +vxeqdit +xtmd + +erwmnqks +zsrpjnmxik +mrspkitny +gvohdnamrskb + +vgck +gkvc +cvkg +vgrckm diff --git a/src/bin/day6.rs b/src/bin/day6.rs new file mode 100644 index 0000000..beda123 --- /dev/null +++ b/src/bin/day6.rs @@ -0,0 +1,76 @@ +const INPUT: &str = include_str!("../../data/day6/input"); + +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] +struct Answers { + mask: u32, +} + +impl Answers { + fn parse(data: &str) -> Self { + let data = data.trim(); + let mask = data.chars().map(|c| { + let c = c as u32; + assert!(c < 0x80); + let c = c as u8; + assert!(c >= b'a' && c <= b'z'); + let c = c - b'a'; + c + }).fold(0, |mask, bit| { + mask | 1 << bit + }); + Self { mask } + } + + fn count(&self) -> u32 { + self.mask.count_ones() + } +} + +impl std::ops::BitOr for Answers { + type Output = Self; + + fn bitor(self, rhs: Self) -> Self::Output { + Self { mask: self.mask | rhs.mask } + } +} + +impl std::ops::BitAnd for Answers { + type Output = Self; + + fn bitand(self, rhs: Self) -> Self::Output { + Self { mask: self.mask & rhs.mask } + } +} + +struct Group { + answers: Vec, +} + +impl Group { + fn parse(input: &str) -> Vec { + input.split("\n\n").map(|block| { + let answers = block.lines().map(Answers::parse).collect(); + Group { answers } + }).collect() + } + + fn any_answered(&self) -> Answers { + self.answers.iter().fold(Answers { mask: 0 }, |a, &b| a | b) + } + + fn all_answered(&self) -> Answers { + self.answers[1..].iter().fold(self.answers[0], |a, &b| a & b) + } +} + +fn main() { + let groups = Group::parse(INPUT); + println!( + "Sum of questions answered yes at least one per group: {}", + groups.iter().map(|g| g.any_answered().count()).sum::(), + ); + println!( + "Sum of questions answered yes by everyone per group: {}", + groups.iter().map(|g| g.all_answered().count()).sum::(), + ); +}