diff --git a/2020/6/.gitignore b/2020/6/.gitignore new file mode 100644 index 0000000..ca98cd9 --- /dev/null +++ b/2020/6/.gitignore @@ -0,0 +1,2 @@ +/target/ +Cargo.lock diff --git a/2020/6/Cargo.toml b/2020/6/Cargo.toml new file mode 100644 index 0000000..18c14d0 --- /dev/null +++ b/2020/6/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "day6" +version = "0.1.0" +authors = ["Stephan Stanisic "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/2020/6/input b/2020/6/input new file mode 100644 index 0000000..270cb61 --- /dev/null +++ b/2020/6/input @@ -0,0 +1,2081 @@ +x +x + +ygzdvpxjk +bzdgq +aulrhfwi + +tpasjur +jrutopas +rtjpaus +sraetpju +tpajsru + +vus +uvs +vwups + +r +r +r +d +j + +qohtkgcpl +yukohqglp +dobtpghlkq +hglqpaosrnk + +zathopqrnf +tfphoznqra +ornthfpqza + +xymf +yfm +yaeflpmc +mxfy + +xhjnyblvetrzcsdfgioqw +nyvjcwruaitzkbsfelxhqmo +vqlebsnycaijwxhftzor + +pvnbhgqxokzfls +ktfiphrwzyu + +snadfrzvj +huravjsfnz +wrfajsvznx + +gzqpt +htzqp +pltxqz + +dwf +fwvd +fwjxzd + +wvkaetlonsmzyxp +flamyzwpnexosvk +ylsoxwnmkpegvazf +xnozlvwayepksmj + +hegoanjwcuqr +unjghwraoecqm + +vrmuincbeax +mrxcevanu +cmanxeuqvr +xmcrunveqa +rvxcunmea + +edz +zgesn +ozqjtrewa +zdefv +czdenf + +imnklhe +flsnkj +nkljfv + +dtkhezmqarglsyujifncbpx +smyaqrdnjzutcpfkbxghl +nzupmhqkjfblrdasxgcty +ltbdpxsmhzkyjargfcunq + +khbnlsgcwdepajfqry +fcglrsedyjkbnwpahz +rngyalswjpecfktbhd +eajkdwshrclpfgnby +eqvgcfpyxdjirlwhkabsn + +nsxzlycfmhtkpr +wmxstkfoyrhlzp + +jqxfycbl +fjztavkuxeh +mxdfipon +eyrvxswhgfa + +yqutg +qytgu +ytugq +tlgquy +uqytg + +lsnvemdftqgzk +ethkglvsqdf +edxfsltqgvk +zflnhgtsvkqde + +zxqiowjp +ojziqxwp +pxwjizoq + +jxfsvcu +scqufxjv + +nmkbsdpth +ekqzlgwuyrcapt + +bvxfjegzyawqtdpkrihonl +kgdxaywnmbthueqpfjvilo + +wukhzt +ztqhipkexwo +zhkwltfu + +dosntymrebgxip +vbakzmsqnxehtyg +besntwxymgju +pbsgyntoemx + +ke +ke +ek + +gkqrxeyhmpwoavszftnid +qablonwmkpridxgcztsehy + +ejnuvyrgwkfphld +vyejdomzqcrtwuigs + +sxjnructhkifz +umktfhirxnec +iunkcfhryxt +hftciukrnx +kuctixrfhn + +m +c + +ktwhurxsgza +huntakrzxg + +bfiecpvksjzgxmtrhwndy +yewjdrpcfvmxub + +kxv +bvkx + +mpkdrilqnvgjszxhbceat +qplbdncjxgzvsimakehrt +abwpdvkcmjihleqsrxztgn +ejkotbiyranhvzpgmdsqlcx + +upykgj +lkqbapvf +wpzmkr +upkngjw + +henpvx +uhnepi +vhpn +unph +gacnoptsyh + +va +v +v +v + +mfgsejknphquwvtzic +nyfhzpkxqtmlwivsgec + +l +l +lr + +vneibmqwsuropl +qulpwvhbmirne +priwulqenbmv +uwbznlqrmpviea +nmvqulerpdbiw + +zrcedpsjlgavqhkfwyxinobmut +wvzastimlhdyeobxckurfgpnjq + +c +w +c +c + +eavhgx +axvegh +xghvae +eagvhx +xaehvg + +qhvryckj +cyqhvkj +vhyjmzcgqk + +inyetbqzdcu +cezuhin +ejaurictfnym +hrngcezuia +xkliecvuwsn + +qowvezrdukfbn +zewvyunqoambdr +zngwprusefvdbkqo +euwdbvqnzfro +xrqovndztwueb + +klpubivcyfoemgdqzasn +stujebgynqmlxvak +nvmqsubergklwyh + +pbsjdzutfgwmxieqcraklhv +bjcexgqskpvolmadnzryftwu +mvxrzwtqaujgpcebdklsf + +balwcovj +jwobvalc +bwjaolvc +lbaojcvw +cvbwlajo + +onvtx +xotnv + +y +ydg +y +fy + +ndluot +huotfw +gouqtl + +usvy +qf + +h +c +c + +vjyolxpgqfk +qbugnhjvpx +xtzaprdcvjqigm + +idryqgoevjwhpal +jwrledyhvgpaoqi +olgejvpdaqwiyrh +ajehiwrlodvypgq +oylrhqwajevgpid + +x +x +p +r + +rnqocxehf +yrjmlgdavuwihox +xrqpnkoht + +yvackuxdrbespfoz +oyxcabeuszrfvpkd +utxobrfckapdvzsey +eoxsdayfpkucvbzr + +jortnzkcqb +bznrjycktqo +zjqnkrtcob +qojktrnbcz +qktojzrncb + +uokgp +krui + +iqbhupfzg +fqklopwh +qstfhnp +nqykmsphf + +jnzpybrvctmgx +pzjbyxmgkcvn +cvxjzgpnbmy +gvynmcxzbpj + +zihyt +zihty +zhtyi +ohytiz +tyizh + +hrtmfqdnbsjceuxgiakol +lxprsezfuyw + +bnpesm +fqhcya +kdoy + +hsfj +qecixr +dyzpo + +nsviyq +isyqnv +cvqdsfnjyi +qvniys +qvysni + +olsytfpiqbcgruavnmkdj +wobyanuximplfgtrc + +fakvjrdemphinxzboygcq +rpxbevcfsodljzqmaigkh + +osh +hoprni +efzcdv +jxih +p + +qhamel +slehaz +mealyh +hela +belahtkn + +ertwyfubagxcilm +gfytuxwmrbialec +cmxybwaptedlrufig +uciewrabfxymltg +geurytlicmbawxf + +pqosuijf +qfsjiup +ifsrpujq + +iv +vi +iv +gvi +vi + +gcpsri +tsmvokr +usqagr + +svtwqplur +thzwuporavyl +ltupsqrwv +utvwlsprq + +apeidznxcr +imgtbyekslu +hseitolv + +tfhpmels +haspqmfel +kplfrjymxeh +pthlvmqef +cehdmtfpsl + +dj +caj +d +vohrlqx + +kuzcdayghrqbtpe +kcpxwmaeruqzhvb + +riwuxjg +puwhxdj +blknsvt + +jtvyr +tjrvy +vjyrt +vytjr +jvrty + +qngcme +qenc +knecpq + +psetjy +xvikrzflgdm +yco +wconu +bucqa + +kdnt +udnz +dnagt +xdkn + +jsikbcef +ksefbi +yeikfbs +snevfqxiakb + +wqtgfxruzyd +jrkfxwtzqdub + +kemcnsaxjfiubg +mankwgqsuxibcj +sbgkvujnmcxai +fgyixmnkdacbujs + +dmrkoujzbvtwsqyx +fqibxwkhmzcertd + +jbw +wryg +w +w + +y +g + +bcfztdseowilyqapun +wpmsdbozlqvciku +xqsbloudprihcwz + +intvfbkagzs +krweqxlajmtyu + +r +p +zjcogl +pv + +fljxyzkgt +ktzlcsigxyf +xygltfzki +lgyxtbkfzj +klmtrzdfegqxhny + +ejfndtrmwlyzxqavhcbspoikg +ajnlbfrcswgmdkthpxiqvz + +ysikgwrpx +rdmkqgsw +wgrchksjf +wykdasgr + +emaizfwdc +adcwsozetmf + +m +r +z + +knvpqjbasl +jqnsvklbpa +dvksqnbljpa +pawskblnqjv +blakpsqjnfv + +phioqsu +gunio +uoi + +wlqhkndiuoxtgesrmpfv +wvgsmtolekfhaxnpqui + +slu +uisal + +fsepbqldiztcwanjohruky +lsbtpoenyvuazqghijfrkcwd +kqzrdphyoacenswumblxtij + +zfbadvte +zteda +otazie +eturlyah + +gt +tgd +gvta +tg + +rjck +ymcv +lctoweb +cmqh +mruchy + +iztpec +ipeztc +zceipt +icpzet +ecptzhi + +mjubdrwxaitnvcekgslhqpz +ldhvzxbrqjtcmpuiasewk + +dkjlrwqbpa +jqlzerbpa + +svupyxrbk +grtnawqcybmdhfiz + +qzjmpxinvwked +bxfuzhany +snxotzlgc + +cfvejdxqrzlhobi +vrojlcdmzebuq + +idrjshpbqtevogmy +ysdvpeuqlmhgbioj +pgwybvmosdjiehu +pvdhcseguyomjbi +kixjgompdbnvfhzseya + +jgl +gjlez +glj +jgl + +zrbxvcuwjidklfmnqotg +lmurpfvqzoxjgwbckndti +umlqjgbxdkrivcntwzfo +wsedxcrblhmotqjkavzfuing +tnqdxjmcrofvbzkyguwil + +dmxcntqwauokif +tqmufiwnhk +inzeftquwmvpbjs +iwgfymqrutdn + +ejsfxcgdtkhoqu +kfhitexsugdj + +tnypmbxl +rxmbnltpy +xnbylmtp + +c +ksc +thcpjf +gmucyaxdz +ck + +xqizlfeksrjh +wgetzlkx + +khnawcubgpx +knctwgupa +kpwngcau +apzwqckgnu +npkawcgu + +itlec +lhectib +lctesi + +mhanjrlytudgzovf +nzjgdapevrh +inhdrjeazgv +gznhdiajrv +jazvhdrng + +itgemupjxbhvs +epsjthguxvimz +jmhxspugetvi +pjhiseuvtgmx + +beln +le +xle +elhazjy +ecl + +ev +v + +ryzfswe +sylrkzc + +vezqnasodyjxlfkgiup +vlkyixzeqdbajfruongp + +td +tkqpl +tde + +lcdkt +tcnkd +okciajvuxdqt + +usoyw +owuys +ouswy +swyou +wsyou + +xmfovdhgnlcja +qfympwaotzvchrlu + +gcx +c +c + +cxpanqwbzjeiruogsh +npqobaijrgwsecuh +vjfbmsagotwpyhckeriqu +biosrpqwgljexauch + +kriedwmbz +ykhebdsjtz + +inblqrgm +rqbimln +nbrqlim + +wdlmasxozvngrkuy +zguaymvdolnkwsxr +gvxadrlowkmzunsy + +frpv +vprasf +irapxf +unmfpe + +icgmloskedvrhfq +xzitwrbjpny + +qbvwlyext +qtblesvw +etlwbqv +tebvlw +hpbevwtl + +bmnpvz +nbvmoz +nwczgybvlkd +abvztn +bnzve + +b +c +b + +tchlzb +gz + +ndr +rdn +dnr + +sctrbhpnmzev +qedsncvaruymg +dncrsemkvaox +yarlncvdwxsem + +sfhunci +nsuhifc +siuhcfn +icufhns + +gnheqlb +ukpd + +lixtrswd +wntldgisx +spclikxftdhwzuejabo +stywildxv +stmlxdiwq + +ehsqnvgzw +neszvwgqh +qwzhsevgn + +etgcydsljko +xoyiqbumwanhr + +hvbqfdkyzupwnctr +jnchwzpsobtkfeqruy + +gvzipoldfjx +zodxivgpl +noibqzgxvldp +doqplvgzxi +olxpvdzig + +sqri +qirs + +nzhagdpqyrtuclsxojbfev +uqznepyjgfoavrthslbcdx +uxztlrfhgevopdbsancqjy +uqrtexnlzvjahcgbdpsfyo +jdhgotuxqvpzsrcfnaylbe + +anytx +mgldfs +vn +jpxn +yujnw + +zdgnamji +pmjnzgdwbcoi +jynmiguzd +jgrumdntiz +mganjdsiz + +jikqaxmebd +uolhrpecyxvda +dafxhtrse + +lbjmzepw +barycf +suxb +xuqb + +xjkpdbsycqzfml +pszjxdkycmfq +hyqzxfpjctwkdsmn +fqsdkuyxcpjmez + +tmxoylwjzas +gqbwlujd +pldwnjibrqe + +oxtwegdyarcmufj +dcfuwrgxmytejo +mwutxyorcdgfej +dctrumjwxegyfo +twpyflemcjgourxzdk + +ji +ij + +hbjzg +czbtgj +bgjz +zjbg + +hziwf +jqhgmlybvf + +sgukx +jxqts + +rbekhvqmjw +wjkmvbrghqye +qowekvthnjrb +jevhqkwbr +wreyhjvqkb + +f +f +lfi + +b +r +b +nim + +ds +dms +nsd + +reydi +clbyfjoqg +pzny +wekuiy +yhi + +ujqkgvwhybdaxfoz +joaxzvkgbufqhw + +zcyhdxriqtolasnwpmfvukg +tpolkuqmhzcyisvndargxfw +umphysgavwqixcdfrlkotzn +wgpruaotvcklnfidmxzyqhs + +ubwgxvmkjz +gzkbmuxwvj +jyuxgbkvmwz +xvjkubzmgw + +cjbalye +naero +aspe +ache + +usfcwigx +wcistfguxz +ishfguxcw + +vowtyizedpxjkuhgln +rtacogzuipjydhxlnew +gjmzenuwstlpxqbhyodfi + +humbgtvizaqnrekx +urixmqaghktbnezv +geabrihuzvtqnsxdmk + +oqdctfig +itmfgcqoyk +ijuoaqxcfthg + +slbj +bslj +lbjs +jslb + +dyhijmulgn +gcxrkbt +cogkr + +l +hl +le +el +l + +rd +dr +dr + +sx +kzfyajw +cuplmx + +yos +ys +jqyta + +b +b +b + +hwotauyxk +koufjyh +ouhyk +hklouy + +sm +s +csig +sgi +esxy + +rgukjdhytpmoewicz +dzgwtkejyacros + +dwpuknfajbeztsvlcir +nbeilkzmyqswjfdapuvgt +zbvuifewstkadpnjl + +lctyng +yncldht + +hdusmgynzxba +auzvjdmhxybgns +hbumansdxogzyek + +lnshkwetqz +enxhqolgkds + +hxczvrwn +xzrwvnfoh +khrwsbeytzil + +qr +o +o +hey + +krtpbuzgy +buztrpkgy +tupybkrgzq +pyubztkogr + +f +fx +m +x + +uvbf +awy + +odwf +fdwo +wodf +odwf + +atnskdpybvlowehzmx +aopknhzybdwtsumlvx +lsbqxonmwgthdaykvzp + +zcvgrlkiwdnjxuyeabftosqp +ijhuaexordwgtlqbpsynkcz + +rb +b +e +e +p + +rgfljswuqmnxdyzve +sdurkno +budprnsac +anruids + +s +q +q + +xq +x + +mkcounerqzvywhb +rhmuwbylqcxzedovn +wcyrzehguqknbvmol +uiosmjcwyfqzvhptrben + +cbafotnhw +ztbwievgscufo +kmrqfbwtcoy +ftwcosb + +pqbdg +lvyknqjdt +okcdy +durhfwzamsi +edkt + +rteknjgdziaxuvqpwms +euqatrgskzjdxpiwmnv +odpxerktavzujqiwsngm +xpajvmrwugsqzdyhitkne +zjpmskatnegrquxwifvd + +ucp +puc + +sbhrmvgkxlwcuizf +irughftcbsxvkzm + +jgufnkhxcrwsqyav +rhjndfxayuqgsvc + +wh +hw +hw +wh +hw + +oskmgp +pskmorb + +zbjxfa +afzujx + +lrucpk +bosmyzdf + +jxtmurs +kmou +uybvqmc + +c +cha +h +t + +yj +yj + +ubhwxkosgq +giqwkhtuesbox + +pwqjdvbzir +ijrzqdub +sjanrzbiq +jizqbry + +m +m +um +m +m + +hmgxpcyfzenjlavbrtd +yvtxmarbphjoefzgnl + +dsmcohpqxzytbefwun +vkglfzxscniymhqurpdtbeoa + +b +e +q + +dr +rd +dr +dr + +peqvdfnayt +qpjcsu + +lfq +lqf +lfq +flq +qlf + +thnkmpcl +fkiavtnux +tqpkn + +zuxche +zcxuhr +xcznhua +xhuzcd +pxuhnczs + +vdtesl +ktlmxsf + +ekrfgonxblyuqwcmithazvdjp +awlpvtybicnhqdxeofzgjkmru +zdyfgtaoilqwuhkpbexcjvrnm + +zutmxljqsbwevaog +jnouplrwkzq + +bvkwprm +xiz +i +gdc +if + +krm +rm +rmush +opjrnmeb +rmuki + +iw +ysw +kl +gtjb +hrndzmf + +z +sjcdb +d +cqs +hlot + +ehs +yabvz +hjsgx + +fgexm +xtjfe +ebfjxh +zsvfopulwnixc + +kmqupeigvojczwbadlx +gxmawjupbvkedqlzco +exlzudcqbmvawjgokp +lgkconmhwxyvqtzuedbpaj +guofmwqdjxvezlapcbk + +yzvldxhqpcregionbwmast +oxbnyzpseagchiqrtwvmld +ivmargzsdlcwhoxynpqbet +dfeczlatxrgybwpnmvisohq + +sbdtompfakqzuw +odwukmshptfizq +pquszdktmifwno + +uhgxdiptswayqref +waqdrxpltvufsciyge + +lxkvhzeruigsboft +hobvxrieltumgyzfs +bovtrghfxeiulsz + +mkxhjuygbvcno +ygoqnubvj +pyzdubtlnsjgvo +bnguvojy + +pmuxezk +odpiyevns + +iergxuojpqwskbdnyt +dtebiujnospkwyragq +roqbendjksgiwupty +nbhftycoqleusjdwpvgkri +qryzgjekwpubidtosn + +hkosdxcnztelmp +ltxcshpodmkenz +aeokdzmhlxnctps +tcohzelnsxdpmk +rlmxzsdchoipenkt + +klodupfxjg +dxouflgj +zjfugadelox + +qe +eq +qey +nkemqr + +kpyahrdgnv +vkrnygdpah +nygrkhdvpa +hngyqkrdcvpa +nhygkpravd + +pojt +tjp +tpij +tpj +ptjx + +ptudvwcsnbzlkmh +pnvuklmedhwcstzb +stpkbndzwcxulmhv +lshkvqbtnmauwpdzc +lvbkdstmhczunpw + +cjki +i +dh +nayubo +zte + +lrsyuzkehwmdi +uilhsekdmwr +ehlmdkiuwsr +mlwuiskedhr +remuhcdikwls + +nevqwlas +tafkhjrndcsgm +aizsxn +anqlswvy + +tdfxwikmqcygoja +pbmnevlsoxkiudhyctqf + +uncjptla +snpj + +mqnwhueayizvl +zwqlijnymve +pkloymxntbigqwzerdf +nvqyeilmzw +icjmlezwqyn + +echgfxinmd +ftcmixeghn +xbikghlcpfnwem +jxcfgedimnh +jehnsmgxcdif + +qorpli +ipohrq +pqirko +prioq + +vcptybfelzaihduknmwgs +hsugpzyftmeiklbawnvcd +caukmbihneywsdvfztplg +tcziphfsbdkmavwulnyge +kcmfhlgbnaztdsyuvrpwei + +yvzouqjilkgm +mgkpqyzotublsevi +iazkvluoygmq + +wphvnftyxedckbzq +dbzhwqxnpvfyce +sqebwpydfvncxhz + +jdtehlm +rz +rv + +bw +wb +bw +btw +bw + +esviqco +uceqvxj +qcvywrat + +y +qf +y + +wdopylavgxi +uomhenqjzbrcf + +gyowtsk +hplycvznxtqw + +xhlomdpznrcavebti +barocdnhpmgtlk +phrtmbdnacol +rgdomapnhbltc + +sdqiauyzgvj +uvayizq +iqyuavz +qauzyvi + +uvrs +usv +svu +suv +vsu + +zg +mge +y +vcf + +gunfyiqemws +esywnimfugq +mfwysnquieg + +ag +gab +pga +agd +ga + +npgitkbz +vxhzakcj + +rkdst +onhzibjuyg + +bha +la + +iepquktyaxmfhnlobcrwjvds +kmfpuchdwbaxqviojynrstel +jwotpldbxqnkrichseyuvmfa + +agunzk +izug + +lawqrc +fdo +dp + +ptmfuje +umfqjbedtlz +rmwxfjute +utsjmfer + +fymhpzavr +lehormypnfwx +hpljurctygmf +upylfqtrdijhbm + +ugscvjxfkh +sihzmngcjdv + +pbwjhdvlntmxuykzcqf +nmisaefgqhcoz + +orcfsxm +xcmfrs +syrxfcm +srfmxc + +yjodxnav + +smvkfxt +sutnflvk + +rgb +b +b + +uahjwtqbeklgfzixpocrvmn +kbjlqzxwuratocmfpinhegv +qrijtvkzbsclmefahpwugonx + +cnvxwskaithmrpdjzegoufly +yojesiunmzclkvghxwtrdapf +fcazyohpuliwmgdnvsjterxk +padmkvwzgyxtjcselruhofni +thjrfauldyvpcisxngokmewz + +jtr +tr +tr +rlt + +o +fx +o +o + +jviduxrqhpzykm +jrlhykixbv +hkyjilrvx +yhxivkrjl +xryhbkijv + +jx +i +rekgmt + +hdigybslxfozca +sbypgfvxzihcmlau +caliwbxzfgehy + +xwbdprtsoqzuny +smkhxcjfaived + +j +j +j + +nvwbegrypaofxq +ofvqxeyrgp + +klw +lkw +kwl + +zyrfuqhnagk +ghfzeswqkc +ekqzohgf + +rgumpkoehtndcb +gcdfkipuvbojlmn + +uqlivpmac +vplcqimua +upmalcvqi +mcuvlpqai + +woi +wio + +zycvodbiatfr +boycztjaidfrv + +kyimbvawqx +mvwkyjcqaiptr +vhiykmaqw +kqmvxyiwa +vakmqwiy + +mb +axhbf +ldpczbr +vhfbym + +zvibckofgyjqtw +fmqzswhpeklyjtbvuoi +fjixaznqkywtbvco + +vxcnagsqdmhuotwe +envfkxdroqawcgsmty +aspitmqnxwedvcbl + +tqsizydbaw +ohejgpk + +xvrzbcpogdyfuhwknmiesqa +oigwafzqnmshkevcuxbypdrl +grhcbdxyuewisvazfqpkomn +mnyvbxcsaeoufpwrqzkdhgi +dxzyrsogubncfqtmvepihwka + +n +n +n +n +n + +bmpkgzfojxelrwtc +qairymcnsuxlokj + +dewfscvkqbtzpx +cdpuewltsbzormq +wvtdngphbkeszcqj + +disryhxvpbulzw +hbzlwdirsvpyxu +irzldphyubxswv +wihdrypxvuszlb + +fxtqpck +xqkptcf + +factlhdbwurgvxiekpszqjo +gjhxkdfpsltcvoibruqewaz +tcpfirvxkjwolzasbeguqhd +vjrfpclktdeshquigxbowza + +pqabsimryhtd +uvlconjzxgwke + +pmyjflwzckdvnergq +zjprwygclekfmqvdn +wykjldrvfqecngmzp +vjfmcynwegzprdklhq +cfqnmrldegyzpwkvj + +xh +h +eh +nh +hldjq + +kapbqmo +fbakptzq +okpcqbat +xjopbqka +ubpdqrkhga + +wyaudlen +eawulynd +wueadlny +uaelndwy +aluewndy + +byzxchgujesn +ygzxanucbejh + +ehftw +lmvfa +hfsg + +wvmfzghpsy +hfm +dhgmjzux +reablkontchmq + +gzwqlcx +bgzlctwn +uzcwdpgaxlv + +nukwtrszf +rfndkzcsomwu +rusfnwzk +ufzwlrnsk + +bv +ai +b +v +v + +uxcdomyb +qrwgzvfnai +lhntkrpjsegf + +fqxugyni +ifynw +ayigfkn +qynafsgi +yfqcni + +yecqrtdzbnhp +hcrzqodnv +qhnrzdcf + +p +v + +afoxchynvipsel +nsxlcohfpeiyav +sxalyfhpwvoneci +xislpcoyefvnha + +najlhzu +zjyclua +tslumedaiq + +k +k +k +k +k + +odetwpfglrcjqmuihx +dyrqkfweansjvmhglzpu + +igskahu +esihkglu +giushk +guhxkis +suknighx + +oxemfvj +xomzsqv +mlnxvo + +tlwfvk +tlvw +ztvlxcr +vwltf +vwlt + +uwmpzlhenva +otzqhxmngylkup +whnufmlzpev +lfupmhnz +vmluszhpn + +nqsireakdvpbtfcwgxy +bkqygapisnxfwrtecvodj +enbvtdisqwaxfpgrcyk +xvdbrwgimatefqcyspkn + +ajumckognwqs +mcwbsjqtkgfdziro + +acpzwt +zlcyaet + +gvu +vg +gv + +qgcjztkuo +ojbwtrxaq + +tecrwjigkqpbnufmldavxh +fxvhgjetlrwdpziukbnc +xkvlhwrtbfydigpsocnje + +kqyn +uw + +caixsqhpgwvmo +uhxomepiqc + +naud +numdat +vuzaednw +nagtdxu +guxdna + +xdmkliqsw +kwlqxamti +vdqpmwlxik + +mixyslpha +ayihosplx +xytbdakhiplrswz +povsiyhflxa + +ynli +boyins +yin +iny + +fgjmlirc +rjfilcgm + +mohvfnrgzjkuc +ujroykmzfwa + +xljiqtkpe +glymhtqpak +etpsklnq +dtpqkl + +cefwpgnbamdzj +zyjeaxwumpdcfnbr + +vxdhgi +hgdixv +dnxrhqvgim +ixvdghb +pgxihdv + +ytbgfrm +mgoty +qjltepmgsy +tfymg + +xlgpjbkwqeavsu +exjaugptqlsbkwv +jegvpwluibkaqysx +qwbexsvfprjulz + +ugnwqbiyp +gnbqyipu +bygiqnpu +gybnpuqi + +tmldrwhgivbnq +wtgdqhvrljb + +cvlt +peoxb + +rblnmixegdwafuoyq +qgoylwxbarumifedn +arfquebxydimnvclowg + +fywzsnhitdcae +tadizcyfsnewh +sawtdziyfngpchx + +vnuhpkriz +lrupivknj +hunripvk +vdkuqsrifnp + +axdzckpvimueqjtgy +ctpymavjkxzreuqli +pedavgzqxthkcmjuiwy + +kxperoiadjgsnfbm +jpikdgrexanmbfos +jrcedfukonpbgixsma + +ugo +guos +guo + +bmhnfupxotj +bjhftongxyupmz +uxbnmjocpfht + +gdx +gk +gc + +fvwc +wkqzcfvh +wcfv +vwecf +cvywf + +w +w +w +c + +eosuimrzpqvyk +kzmicpqvexours +ivrmseztophqkug +kipmquyorvezs + +fpmkrd +tzupnklqxfa +ypfgek +jrfcpkbd +ofkgp + +qrwoydm +bgtlcxpsh + +gawqbjoyrcvizhpmsel +aveozrfgjpismdbcyhwl +rchmbojzqiweplygvsa +zbvclsxrmitehywjoapg +yjhimlberdvscgzpaowu + +qawpmhydzn +rfbyw +wgokjfy + +pnhbd +qfug +fdep +imowsvtxlzkry +ajg + +nquegztm +srnj + +wit +tusiv +qmcoftrljdyk +t + +hxbsozmwegqjkicufl +likdywshmvxuzcfqb + +vtaqrdcfoybz +cfozirq +frkqocz +qfhrzoc + +t +t + +xjqbomigwrfckhsynva +mqoniwygafbkcrsjvxh +aicnmeoqgvwjyfurxhztsbk +wfrmbcaivnskyhjxqgo + +vzad +dvaqz +udazj + +dqsvrj +jkcq +ezuqxjm +qdtavj +jtsq + +qgawvsxo +cpmaxziubdewlfnt +rjsxaw +hkwxya + +lmbopvufrxnw +mvdnioxjpaqeyfrlsgh +nzmtklorpxvf + +eqiwxhrvudokt +xumrqhvnswiaky +vupkbiqrmwxnh +hixwqvzgck + +ziedvfb +fvbezid +bidzefv +bfezvid +edizbfv + +eglq +lgeq +qlge + +pabzfmvsxdqoykhurtjl +zyleahvmbocxpkrtfs + +g +g +g +gv + +mgwxotefbiqjudn +uoniqfdtgxwbjeml + +ryzmxkwosabecqvtj +bftceznowiyskpqvjxdm +ecmxqktvoswbzjy +czjhkyvsmwoetbaqx +zqrwuyesmvbcoktjx + +ytanuz +byanf +jpoglevikmyhc +wsqdyx + +uzwbmdsgafvyk +noqlhcjwx +qxrtpowh + +vlsgakpqfjemz +kgvqauiesdjlfnz +fcegqzsjkvla +kglzqajpseyvf + +hztmnjip +cfptrw + +kaeubgqoxsfiyjtwmhcvzrnl +ikmhteubjczxyvoqsfln +vnxsukmbecqljfidozyth +ushnpjevlkbocxfmiqtyz + +mye +ezmy +mye +meysnt +yme + +xtvlmhrbdypeaf +bvxftlaephdmyr +dhuxmtryeplfvab +vxrmaybhplfdet +vxrfeyhplbdmta + +pek +pe + +dpo +gpdfjsaho +hnpo +dpamoy +wvueozqxp + +wjdqzpftmhk +vmtod +tbdmg +rytuvcdbm +rtboyemdca + +dxmsyfacqoigtuvjnwph +upojvbynselfdzhkwqrt + +d +dmo + +cymqgxwurzhdbteok +acydrugmobzlxek +xmugryzcobked +cmbyokexuldgzr + +uebznq +ubqzen +qunbez +zuqebn +buzeqn + +uewpvklzhoqifcsb +rlvdyhnkjptiwxgab + +xgdazmoqwislvb +qxodszwlvbgai +azsdiwlgqoxvb +ldzvgwoqsxiba + +ozbnvjquac +pgntbvw + +aexsklbwjydt +akjbwedsxylt +keaxswdbtjyl +leykdbstjwxqam +xewlkdytasbj + +ahzvbeqsctofui +ueabotfhvdzcsrqi +obzhuvteqapscfi +ovhbpuqcslzfieta +vbfhtqszaociue + +ugilv +ivlgm +vxigrl +gvli + +qjni +qongz +nyqj +sfdqwlvcxn + +bcgdtuaxmlkrevof +ftorcabmwueykglxd +tahfxumdobrclzikneg +xakfmdtgocruleb + +ihrobnmcpqtgwk +hwkrgmpoctuqni +nwiphcogrkqtm +whrqpktngmycboi +vjiwsothqgnkdrzecmp + +fmvhjo +fomhvjq + +pkvcijtamu +xijwkrbmluneta + +evjomncktgpu +gumxn +mnuyqgfai +luqxgmwn + +vgxsetchwpajodzmu +tubxpkqheniygjodwm + +zugtaqdsofhpe +tuqpdhgar +ugnoadthq +yvkugjhdaxbcmqt +gthudaq + +dzfmjsgaqubntpkvleo +zuwgvfbkarlyxpdihnme + +z +z +zp +zb +z + +khdj +dhj +hdkjrgz +eofuhjdta + +gauozreitvy +oeidrzyv + +zlvxcidkob +obdckzlvix +olckbzdxiv +lkxcboidvz + +rpslxjnfh +bhvuytmosdzaqwgk + +rbjloemzv +zlbeormj +rlmbjezo + +djbyqfcoknxsmtzghrp +hksxmbyzgfnpdjqocr +cjodkxfrpgnmbqhyzs + +ko +rok +kwo +kgio + +ypocjw +hyw +pwy +iyfw +yqwgjv + +hyto +hqtko + +gw +g +ag +gj + +sckdazw +fazodyc + +wofxjgyqurha +fhxjboaerg +ztsgrohfjcal +hjgxarfou +rvqyegxakhbfoj + +coat +coa +oca +coat +oack + +tzcdyrhfuxisvlgm +txuplzrcsjhmyavi + +ahcxfelbv +haxlbfevc + +owfizxugtsemclrypjvahqdnb +ugncvldopbwqjzmxhirfaet +oupwmqnzilhdtcbavrkxejfg + +fjyagkzt +gfyktjza +kayfgzqtj + +iutxmzd +dmtuzix +tzmxidu + +cndejklaphsquowi +pjocdlehukqai +hixujeqlrktapdco + +xcapfuiljwgqsevot +tlfdxuwkjpnqvsmoeg + +madurwbn +anwdbqmru +rdwubanm + +gl +lanp +wlkijdruy +zlg +hlx + +d +da +da +dmwp + +e +ey +e + +mcxndruabhvp +pnqudhcymb + +qxldtifpvshowjbkemza +hvziwsglkjepobfmqaxd +hzxeslvdomagbrwkjifpq +hbxdsfkizqvljwopae +zucafhbkvelxoqipdsnjyw + +hoeqg +fqghrt +gqh + +v +r +r + +iovxlnqsz +iosnqfxzl +ozxinsql + +pqsvfxihdmzkrnacobetjluwy +wytcbhvxsrndpafleuiqozjkm + +ngi +ogi +ticfga + +qg +drl + +mzbfwevsodakx +gdwvskin +vdskwli + +jienvauxkgfdqh +qdhxjktavizcpnuef +fkbqueiladvjnxh +ukfwjndxhaieqv + +gdlrowxahs +lusdcwhyg +dwalghs +hzdgitqeflws +dgkhlws + +pmjkz +kzpmvj +pzkjmh + +dshpxl +vbtmniafszewdkxup +opsqdxyj + +etki +eikt +tiek +iket +ktei + +yvfta +atypkqfv + + diff --git a/2020/6/src/main.rs b/2020/6/src/main.rs new file mode 100644 index 0000000..19de23e --- /dev/null +++ b/2020/6/src/main.rs @@ -0,0 +1,45 @@ +use std::fs; +use std::convert::TryInto; + +fn main() { + let contents = fs::read_to_string("input") + .expect("Something went wrong reading the file"); + + let groups = contents.split("\n\n"); + + // Part 1 + let mut nums: Vec = Vec::new(); + for g in groups { + let mut chars: Vec = g.chars().collect(); + + // Remove duplicates + chars.sort(); + chars.dedup(); + + // Remove the \n + chars = chars.into_iter().filter(|x| *x != '\n').collect(); + + let size = chars.iter().count().try_into().unwrap(); + nums.push(size); + } + + let sum: u32 = nums.iter().sum(); + println!("Total number of answers is {}.", sum); + + + let groups = contents.split("\n\n"); + let mut count = 0; + // Part 2 + for g in groups { + let lines = g.split("\n").count(); + let chars: Vec = g.chars().filter(|x| *x != '\n').collect(); + let mut uniques = chars.clone(); + uniques.sort(); + uniques.dedup(); + + let totals: Vec = uniques.into_iter().filter(|x| chars.iter().filter(|y| **y == *x).count() == lines).collect(); + count += totals.iter().count(); + } + + println!("Die please fucking die this is stupid {}.", count); +}