diff --git a/day_6/.gitignore b/day_6/.gitignore new file mode 100644 index 0000000..9d7da6b --- /dev/null +++ b/day_6/.gitignore @@ -0,0 +1,3 @@ +/.idea +/cmake-build-debug +sample.txt diff --git a/day_6/CMakeLists.txt b/day_6/CMakeLists.txt new file mode 100644 index 0000000..71cae97 --- /dev/null +++ b/day_6/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.19) +project(day_6) + +set(CMAKE_CXX_STANDARD 20) + +add_executable(day_6 main.cpp) \ No newline at end of file diff --git a/day_6/input.txt b/day_6/input.txt new file mode 100644 index 0000000..e4994db --- /dev/null +++ b/day_6/input.txt @@ -0,0 +1,2237 @@ +atxmhdzkjgivwcqu +conirfdgplhvsa +ghbvdefsaniyc + +c +c +cas +xc +cz + +sdxtfzo +stfzno + +t +t +t +t +t + +nkjexbhrswugov +jxugwhbroves + +meqnof +vxwhzpmqo +jno +bkoliycr + +u +u + +rbyuds +surjb +lbrxsawhu + +sd +dq +ds +ds + +zo +z +vz + +czhuijskmt +utszkmhijc +kzmuictsjh +chimtzksuj + +uwhmbl +wblur +wublm +bflesuw + +bo +wcszvk + +htfsqoriyngzjbvx +dujtmikcpzrwehaxl + +rubwcon +vwo +omwhl +rxwbo + +aj +aj +faj +aj + +nwfmajzslokrxhgtyq +vicapdwkbuh + +vdwysctjq +jmilqgh +jqgf + +tnoemqphdcbj +jfavhsqkntg + +qjrpfwckgbvenam +qpucwvgmjfabro + +fmqwzhbytnacdr +fmncdrhqywatzb + +r +w +w + +umrbzaypkwinh +eyuwhi +yhuwie +ehiywu +hwyui + +dxynjlhfbi +fjxd +mxdfj +fdxmj +jdfoxs + +ikdeutpqynboghfs +yjfkmidnqtgueb + +jpzfsbwgdkvtiymneuca +vbpkjgtdaucezymwsn +ctmydbsjgapewnzuvk + +gyxjvqk +gwkjfvi +rkcbegvjm + +sgzakoq +koszqa + +qmzjhtsodfurnpegy +aurfdgojzmetpnbis +gtezmrodujfpsyn + +qyknpixtrfuolw +fkpwgntyxlqumrio +yrflupnoqitxwak +iypferukwqtonlx +qurtxlnoiwkyfp + +xbweyquhnairjtzopvmg +byhuwnaxqoimtzepvjrg +jzxbqmrnwgvdpaeyotuhi +nwtpovmruhqieyjxabgz +yoeamwhqbrtjvgniupzx + +ic +ic +ic +iuperc +acsi + +oicl +c +c +c + +uyxbejfrqhvpcknziowtlad +fxhnwdebmjzpitkgqualrv + +me +me +wme +yemc +em + +zxgncvbdrewkyls +lzbnwesxckgryvd +krvsyadlgbzecxwn +nwcblgzdsxrkevy +vgwbrxleckzydns + +bdrhenpgofqyv +uazwsjlitk +wlcatxm + +jsdnlwkto +onkdhysjtwl +ojhkstnlfwd +wfjeodnklts +wkngdtqulaozjs + +jseag +lazegosfj +gaesj +rjagse + +vycnwzfah +yhwanzcvf +fycvwzhna + +kdenoqr +drnokqe + +fudosahtj +hzygvbjdu +qubhjdep +ezdujxbhw + +asrfbcnuywm +nyrawufmbcs +mbyrasnufwc +fusrncywmba +racbyufmnsw + +eldyp +pgdjb +jdpb + +xiky +ximqy +yxinl +iyx +yiekx + +lzbmt +otbpu + +upobyhamecgwtjkx +kytepobcxhwuajgm +kobtcgphxeujmwya +tbpjehaukgycwomx + +lgjrbcymkatpx +pbazritkysjmlx +tkpymrejqxab +tayxbjnlourdfpkwm + +kvqxyecmirno +einsmcdxkyrvoq +evxqrkoiymnc +yvikqxecmron +yqemnrickvox + +tlroieuszcwpkdbmh +ypgxfdatn +jqpdvt + +kuynfegcxrt +ytnuzecgfxk +xhgsflynecw + +q +q + +mu +um +uwm +mu +um + +abyhrzfe +yqhrfebz +frhzeyb +bkfreyazh +ebrzyhf + +vdo +se +x +x + +peckiwfxzqsal +paiuofxlqyczeswk +zxlarkseiwfcpnj +lnkijaeswqpfzcx +mtpilgsbchfwzexka + +vnuoec +fveonub +evsrniquo +ondeuav +nuovte + +ypnmo +omypn +ympon + +pgbej +pjbg +pjgb +jpbg + +xwognfphakcjritb +fvcoexrpughatk +orahqctxfzgkp +xgfrhcokmapt + +g +ytab + +q +yw + +ravlebmfjodkzgu +rujyetlnszmkvad + +mgktpszhdeolvbqa +oqnbagktzpvshdle +sltvkgpezabqdh +kpsghlqzedbaft +dknetrlqgpzahbs + +rejugfqtbaklixcmhodwsnyzv +gmukinscxjpvehbrodfqyawz +aswfqonbuvhkdizjgmrxyec +jrgiyhdmwcexuqfzoabkvsn + +nfcsiavmzglehorwd +orcmwveigashnzdfl +gcmhdvfawlsnzxrioe +qfehovruzlgncwmsida + +qrufx +frozu +qfsrjub +nvfuxr +wcydflreu + +tawnehfqjsc +ocaznquitbs +pnaqcshtv + +twvz +tzwv +zvwt + +ejv +vje +ejv + +zicejtfhnuq +hzjcquitenf +vjznuqhtiefc +tuqcnjefzih +hitnjezfcuq + +w +w +f + +jufqelnptbragsmocdwk +embpluswrkdovjnqcfg + +spzytuih +tevqnxrhi + +nxeolsqucv +losqenvu +nveljqugso +opurwesnvql +vbeflqugwnosrp + +fcekwrx +vczrowmxa + +ydtqbl +ldytbq +bdqltyv +qytldb + +fzbucokxnimrdvsplta +ztnkgarvdlxfiwu +udzxtkfvhrnlia + +qnzmokyluv +oczmvlnyqku +kvlqzymuon + +qchbuvepxwm +ubxvpcwd +wsubcnvprdatx +rvpbxydcwu + +ibeayjghko +cslrtwdvmbxqpfnuoz + +uzp +uzp +pzu +puz +zup + +gqhbwupsmeklf +ebmlkfgshpwuq +mbsqkpgewulhf +ufphbmsqlkgwe + +pxsqkfa +pkmcrqefgx +kfxpq +pqkyfx +kzdqfxp + +yimkxaqtcnospueg +pngtsyqkcuoamiex +ncygqsmatiupxkeo +quichtngeypsaxkom + +jew +eylr + +uc +uc +cu + +gapelusnokrw +zloakewgpsrun +pnrkwosagule +nuwaesypkgomlrv +iarpwkugolhesn + +qdyzmoitxflwbnver +udwlojxfipkshacnqvg + +butecshxlvanoy +octsbudkilhnzeyavrxg +tyavloucspenbxh +qebhpxsunovalmwjcty +xhvstmbaulyceon + +vtspwicxbz +spbzixvtcew +vcxpwtsibz +cizvpxstwb +tiwcbxpszv + +avrgucfhxjblspwzmdtnyiqek +wvlmbfipargeyxscjthznuk + +clzbqry +lrebz +zlbpr +urlzb +lbzr + +dvqtxlgowke +idtvexwlog +wvlotxgde +dygtopxlvwe + +xuybmdgwacejltzkhr +lojbxtwyrhdgufkpec +lyebujkxhtrcwpdg + +zhxigcsotywpuelband +girdhbonymwfpuvx + +profkjw +nylxubzptsg +vidrop +ewpfh + +vc +cuv +vc + +gjytrlzpeonxwcdbafh +dhxgwpyjlroazenftcb + +fymaqc +afmcqy + +wxcazpmrfyb +pnvrzhacfji +zvctfapr +tpzlchiafr + +izrdmuwebqk +mreahwzsuqd +ruqyezahwpdnm + +rj +jr +rj +fjr +rj + +txjnrfocwlemuiapbh +lqjuaweo +aujlkesoyw +jwoealu +ujodaelwvkgz + +zo +zo +z +mzd + +dx +c +c + +mprvcwluqo +tloukican + +odvtfhqjawgpzbxre +tgoxqwrfhjcbaev + +fdaljwguepsiykxz +lpseagdjzufkywix +sywukzgjlfixaped +bpuyjswgrkdaxliezf + +uncv +icnv +cnvu + +ktaqgr +twgaqykrjm +vqgpkfuxtchrae + +armwntdgzfxikehupj +xtfhgjmrdzpaiunewk + +yxrkv +vfykru +rviesjyt + +plyfkjxasvuzdcgbtwi +xzjiwylkpctbfvdugsa +fkxjvlbactydpgzsuiw +qgwcbfjtypzkvluxsdiam +btzplfwigkdjasxyvuc + +gwloycsuz +musyrzwlaoge +uovyzhlswgc + +qndaivetjcgblwzsykhu +agorkdnxvmswpfhqiuetzyc + +fgxopdsinm +msgdeponfxhi +xpodgmsinf +nfmodxisgp + +rx +x +x +oxed +x + +twrjcfumd +cvjbfuw +oyasjulepkgwx +umirnjw + +unhbzo +hnuobz +uzonhb +ubhyonz +uzhbon + +arfjnt +netj +etnqj +yjxsntm +fntjvg + +khqap +aqhp +pjovizqh +qph + +uosyjc +zrledfqmpi +kjxotw +tgay + +nrzckijesf +ihrbgsjn +jshbintrom +hrmnsibj +mjsirwn + +ilqbcavozr +tarjqpolv + +piokgqecjz +gfjkleochzip +peczjiokg +zkpjioegc +zciekojgp + +pwi +wip +pi +pi +pih + +gmjlzhpkqbfiuvdsy +djfvsyglzcikmqbup +mzsjgidkewauvqflypb +vzuglyndmftspikqjb + +l +jl + +yiucsmkgalz +iaulzghkmnc + +pny +pkyn + +mgflvdoj +vlmodfgj +joglvmidf +jdomlvgf + +bctiyxqnazrpd +qautyfzjegx +tyqaxzojv +qajgytzfx +xqazylt + +wmkauglpbyzno +djrhciqfxs + +zvk +zkv + +vrlencohidajmxub +xordabecpnluvmhi +njrieodvaclbhumx +uebfcsiorldaynvxmh + +m +m +om +m + +elyhutb +ethub +utebh +txzuehdgbnr +ubeth + +os +o + +va +hv +hv + +espkqfnj +neqp +nepq +enqp +nqpre + +mzthqn +drnmtzq +tqmnxyizw + +kvt +ftv +vlt + +vasmgbthenrwxdicl +xcbstgrnvedwauimhl +eamctuvdgsrhxniblw +bknedmhcxigrwtlvsa + +yomwcsxjienprztgubklvd +ivfgqukempnbwaryj + +huvpmdyswlj +wpyhvljmsud +mdhwjvuspyl +wlypuvmjdhs +lmjwhyvspud + +lmwjpzcoavteiq +mlwkogxvabrqejci +ajmhcedvliqwo +vomafiwqljcue + +mpukzsthlv +vwzpkmhult +kuvhwtzmlp +vhmjztplku +utmvczpkhl + +ghmjkozbcevyrdixwputf +ejmyvnpgzkwbuxfoctdr +gdjmetkfxourplyvwcbz +rojxycmfteuvwbkpgzd +eywujmctvqgfdzkxrobp + +thoagp +btaphg +ptaghwm + +vnmuxtqjifowya +etqlonrwmfadzpxbuj +gxjquatnmowvf +onmfctjuqxakw + +beinxhzlmjatkc +hmxctiklajnbz +zlnkxctjhambi +tlxzhknmwjacbui + +ycvpzimohndk +imyzekhpcod + +peaxqrgofmjbytuzvd +wduhliarofgxzntjev +jgasdekoutvrfxbz + +pkstbjaclrzd +kelpszrmg +eojrskczltu +ihrvlzxqfsyk + +rpjdlcybgniahuzqs +zhpgruqjtcsabnidyl +utljniqdrpsbzhaygc +znojdrpcuiyqshablg + +xtnjlk +xknjti +nxkjt +tkjxn + +hcleuvbargstowm +bhwoulsegvtramc +hmasguvceltwobr +arutogvschmeblw +servlmabghckwotu + +o +o +o +oy +o + +gtjbzkvas +bgkjvtzsapl +zrvtgwcakfjbso +tjbkugvasz +vbagszkjt + +gfeoirwlbmdjhk +kirjwlhmoebfp +rolkeiwbhmjf +hbirkejwfmlo + +yzptkfhal +tlzfkyhap +tplzyhfka +hfplztkay + +vmrqh +vhjmxqgyidw +qhmnv + +jdhwkilngubeoa +sxpluz + +jusbk +uxsz +vylqdmugtpne +azfu + +zxtbn +tbnx +tbxn +btwxnu +naxdbt + +v +v +v +v + +ioruk +uriko + +unmxsykzgcilw +nokmu +mjnuqk +akunmv + +rfyibxnevstdz +fsextzdnvbyir + +ehsdnwqugifbvjlk +xkesuhnfldijbytgwv +ivjqhwfdgskenulb +vlwijqbsfkzudegnh +ibudhwelgfkvsqnj + +whxsbrjkqy +dxhkwfsg +hxuonzvictapme + +ui +ui +iu + +ofzuh +czquo +zohu +uzof + +akphewcvmiqzuxdsf +frmsviubcqgkzdwxjnh + +jywpvmdhut +xjeakczsi + +xaenzqsirfm +xzsanmqifer +xzfoqrsajmein + +ypirboxntkl +yobrxintkpl + +benomiyjqdptszaxc +ncayqsmbjfzpotx + +poygwzfkuahrvqimbnscjdexlt +xqwnagemrlscbdouykhivjzftp + +vsphtodb +dstvobp +dvpsrbomt +htovbdsp +psodbtv + +dyxao +oabtscl +vhgnaui +aesm +eak + +gw +krosgqelnc + +hvnfalkbdcexi +beunfqcaxivkdl +linxezbfcakdv +kdxbiecfpavnl + +bp +qul +b +p +p + +wbvefx +huqymact +gpir +moykz +dju + +dt +dt +ted +dt +td + +elhjvm +mu +omnap +fywtsmrc +ogrzm + +efb +bfr +fb + +puszjmhfo +axjwtomegyrku +ldvbujchofmz +jmdoupl + +bvweypzsfroah +knpleztqcgrvdashfujmyio + +rgdtzhj +ohswzxaijd +mlhfduvznj + +faqdszhwtovk +dhfvskonzalurmtqwc + +ectigrqjnhyzvxomlp +gprjuxloceibv +elricvspxjog +fivcorpxjgel +rclogpejxdiv + +cgshrel +anfsk + +y +smgwxh +d +d +t + +xwvtlpayobgshjq +tahyjpxlqogwsc +slgwptojqhxy +tzywskjlqhpxfg + +xakmubfreyop +zsaxruky +kayruxst +axulykqsr +yukrax + +gqhsy +vdkc +ikexpt +alujfmnr + +qd +dq +cdspk +dt + +kv +lvk + +lcn +msnyx +uepnl + +idwqrmpjzo +dojqzmpiw + +yboluqi +xzbenhvwftos + +vsqmcylrugfezitxbhpnaw +ebcxztpvgaswfyiuqolhmn +ywqmpxzesuovtfighclanb + +fwpxel +zlefpxwm + +xahkdvyig +ugdixykhav +hagkivydx +ahykgjvdix + +fqypwlzaxcnh +mbjfrzpakwd + +foajsvbkqnwurhmtic +jfwxuhmlyetcpgra + +saynjgeklirmfozuth +tskreflaogzcmnyiujh +jiylarkmshonuftegz +fjxrtdavnmgiyoeuzslhk +glotsukjrfyahmeizn + +fgvzuiksxlptcqwmnohr +oqztcmspnhwvijkdgu + +whfx +kfh +hfr +bnjzhsdfi +ufqch + +ncbfhpexm +xremnpfc +bencmpxfw + +rpyknb +ktpcb +cpzkb + +beou +uej + +qgyudcrhfml +pvkjzneo + +azosqblkfdjuipemwygr +nxqjumytrglaohsidp +uoamsqgyrjdiplx +dlumpoyarsgjqci + +pkbhegfducs +sukehcfbtjdg + +qfjm +qkselfmob +qfcxnvm +jmqwf +mfq + +ivmpywfqruhs +rupmfhqiyswv + +dkav +vadk +kvda + +kincpbv +cknuv +vnuckxag + +flhdeonaxsciv +descoflahnvix +nofiacdvhxsel +ehlfoisvxcnda + +hs +ztedwx +nlva + +meqycx +cqmiye +qgmotyce +mcqgye +emcqy + +dwshy +swhyd +hwyds +swyhd + +wbqvtxal + +tlfdbvkyu +flydbk +bsrpfidqxky + +unwtfcv +kvrfbnw + +xazgi +agz +ysga +nawgv + +swtx +gnqayohzm + +un +z + +tr +g +g +d +k + +dl +tl +dl + +v +youdan +ejm + +arktbdczqfvx +qtzxbdkarfcv + +gfve +vefkg + +emojkagtqclzxdf +jtamfedbocz +hzpijrveasomwdfcyt +metazdkcjfulo + +uplwm +pwulm +cmwup +wupm +umwp + +apjeybkdmq +kdjqpmyea + +k +k +i +k +eng + +w +wh +f +j + +rykcomu +mcyorxuk +muoyrck +rcoykmu +yukocrm + +uc +mcn +sfl +exqazjb +vdc + +hpoack +cltek + +esjqog +qeso +seqo +qesoy +eqos + +d +o +v +ag + +rnzgaehid +parned +dnaefr +pdrnyake +sernad + +xzhlvcnjykdmp +zlvxihpwjkyn +yzklnvxhgqjp + +v +v +vt +v + +ksmfiwl +mklsfwi +sfkmwli +ifkswlm +imlsfwk + +nzogsphkcw +hkgpowzcbsn +gowhkscpnjxz +hspwckgzon + +kqoxpyvzuw +lorghcfmjte + +uldnticjqhrzwmx +mnwuqclgzpjrske +lfcynwrvmzjuqa +lhnomxjzuqgcwr + +tdpxnfrj +txpjdr +ptjrdx +dxjtrp +rdpxtjb + +zfaeqorn +qmezdfxr +uqbyeizphrgtjsk + +ghizjpctfdnql +rvoaecnykifdtp + +liszmpruehocfndgt +bdiruxnsfplkgoe + +mzvcwhrqabpnstxjyoleifd +mbwtcxlzosyeqpvfdinajrh +hqenawizmxyjvlrptbcdsfo +tzovqajmwdsepcyflhrxbin + +ehodx +svycbltpmoa +irohkxe +fzjuo + +rv +rv +rv +vr +vr + +axoez +zoexa +xozae +aoxze +zoaex + +vmgthlaxsnbidk +nqtzilcrhgsjauxm + +oahz +hzqaoc +ohaz +hezao + +obkwvazgc +kvsaegcopnwbdz +zgkbwvoac +kzgawbovc +cgoakzbvwl + +klnmgi +mciln +scnpi +yniw + +ekwcfunhsba +sjuhcnfeakb +sbefhaqkucn +kaoudnferscbhy + +ebcoplsnuw +camnjlepubo +lsoebcnupz + +tfxyvgznocdleb +tihbfsn +tnfhbp + +eyojwm +yjomex +mjeyo + +wpvtdjzrcf +xmfuncgiybjhpsqlkz + +tzcwnlei +twceinl +inlcvgtkew +ilcwxetn +ncmwtaiel + +hzwocd +qvhkn +hytliebm +fshq + +sxlbnowmv +msonwxb + +hdknsxog +nfojk +avelwctzqmripuy + +slgrm +msrgl +glsrm + +shjieplz +zogimjcv +rkfqxdynwbu + +oejgdcamtxzhyn +jhcntdealyzxogq +ejthagzcxonyd +onxdjsmycgztaeh + +uyloghq +yguhlqro +uoyqlgh +ouyhqgl +yoluqhg + +oxqtmpjzieunbdak +nlmhzwjedxouyisctfpvrg + +kmrnhzcad +ahzrcndm + +sbcmuhfkanitw +scbkmaftwhdinu +swmbkhnacitfu +ntcaukbwmshif +kswhbufimctna + +nlhwqxvpjgmsr +rvgmyjxhsplaqewn +smvnlwgqxrphj +qjnxpmlwhrsvg +lmsjpqrwnxhgv + +fivwsrdz +ekcq +xg + +umhborsxcg +bghsmqxuc + +jwnv +wjnv +vnjw +vwjn +wlvnj + +vlfhdjz +hjlzdvf +dozvmlhfj +jlhvzfd + +fue +ksmad +l + +wcjsaepudqvionrt +rlhydbgixmznkcjt + +cqh +qc +cql +qc + +kwapzcyisfexgmolnhbrqv +vfdlyxsmkotwhbpziraqcg + +ctmgd +gtdm + +xwornpgqkmizhutfdlb +nzdjoiwprvhtflkcgum +trigoqlwhzmkpdufn + +nix +xni +nxi + +nrvcsp +fjbkd + +fvdmgq +fqdmvg +mvqfgd + +blx +x +tv +rkqzge +l + +j +d +uc +f +j + +mnqbwykj +nksfmwtbzepi +mndjkwrqb +dbkwnm + +eskvjnozwclrumqgiydhpat +zptyjudvmlaehnqoiscgrwk +epgmahlktynjdsvouqizwcr +mnltkagqcxwyveidsourjzph +dpmjiovtqswrzluhknyegca + +wd +ws +dhw + +hcs +shc +hcs +chs +sch + +fsajcbywgh +fougyesbrcahjv +bfhsjyagc +hfacgbsjy +yjagcsbhf + +ymnkoucts +sykmzotc +ouyktsmc + +v +tv +v +v +vbf + +uxplo +upxl +lxpu +cunlxp +lpux + +bclgqmi +ibmlcg +mlibgcan +ligmcb + +je +kje +ecnhi +jye + +xoy +yxo +oyx + +tdkglesr +pqkrhevxulo +rzsyetlakd + +gauz +zuag +zagu +zgau +zgua + +vsph +huspgvl +vpksh +puhvg +ahmpivodq + +uewjqlcdghxszbr +ntrxwsljz +lrojxkfaszw +zjfipyxslwrv + +dqkswrctf +svwfebmkdrzpyqjx +rdswgqnfklt + +njwzbhkfilvec +nvjcelwhbgfz +efcwlhbxvzjn +sefbhpljwzcvn +nljfcvzwexhb + +tiflgjea +ogjfaqvitl + +avrklgztmw +mzwegvnkatlq +vmtlakzgw +magtzklfibwv +vlaetnzkugwm + +vfa +atvf +fva + +pgxnohyielrtdbzk +txfhrpyoedkgmn + +cry +cry +ycr + +sqogwpir +irdoqxwpge +gqrywipo +pdwijgqor +gfvobipwqmlr + +mb +bzm +z +q + +bgowltrfchp +gbhlopctfrw +rpohbwlcfgstax + +gquyvhfizapblmdcnkewx +mwsukfhcqbglexiavznyd +iefbqnxvwlzmkuhcaydg + +wctkbxhpv +ladpwgrzovshmt +untwvihp +etjwqphv +yvptwfh + +eqsyvjwfctgplhxabzr +munwkdibo + +dqlbhkcwzrsmtpi +wklrtmsdczhabipq + +qhesvmjdyxw +ivqetudjb +javdteq +joqdve + +krdltagi +pcgqmxje +fgmb + +olxaykprm +mpylsaxr + +wm +j +j +j + +fkcogpsdjbhmrlixwya +dxozrtmjsycpiwbelqgf +wgunpmldzxfeoiycsrbj +locvwxgfjmsbtypdir + +ek +ke +ek + +jxsczemidvof +ovfmdzicjxse +edovzsmcxjif +exfomdzvcjis + +bovesgqckmlnzd +lozkvnegbmchsqd +kglnesdvqobzcm + +iynrwcudgzpvmbhkl +phybgwrjiznlavudc + +inhflg +lghnfqis +hrlxfngi +ghinakwflyu +ltrnhbigf + +eij +luej +wcjep + +cmbwja +macrbwg + +gbnaxskwovjhqtyf +nhofbspvktwqz + +pmq +s +c +j +vs + +t +ty +tn + +glxsy +yskixgjld +bswalux +nxjls + +vueh +uevh + +mjvlyedipz +mvzdjeiwry +mevizodyj + +brhntfpvglmo +cmzvt +viamct + +ymbviloeqth +hkltyqcmoxudjnb +bwqzmpytolh +movehlytbwqi + +lbdqjzrfayh +afgdebjthyl +hdkjbalfyu + +yv +gv +v + +dxyqclmgvpahor +ktjmr +zbwfnrm +mtzewjr +rmsui + +ghksqe +nlerhxqkmsvo +qekshg +heksqg +qsgyhke + +jecfapg +asgpmjnfw + +lshjykoirpuzcgmwdqv +qwgzoudypclsvrhimjk +drmjwylhqvpigcsuzok + +poclyq +lpoycq + +wsfcn +cisz + +o +d +o +o +o + +goqubkareptcj +mkrcebtspaj +pkbjracte + +lcwvagpbzi +lwgap +lwgpax + +nmxilaeurpkbcqt +excklrinuatyqpb +oxzrbcnqlgtapiuwe +qbtodxcnreuail +fqevniubrjclstaxh + +kbqclfmnrowuzh +cromfwbznhkluq +cfrunokbmhzlqw +ucmfbnwkolzqhr +lcunfhmzkboqrw + +zabujhtvnkiwlprse +rwbxgszjhfdotvinpela +ivptyewzmhdcnjalsbqr + +m +mocztn + +docyu +uzdocmy +ocfsdyrut + +n +n +n +ng + +zntxuekvgasqjbhdcpywir +bzpakvruhewjqiycdgtxsn +dwgubaxqkvepizsnjrcyth +sthxpekqviydwazujgrbcn + +e +ke +ydv +e +k + +ausdlnoefwzyrxbqmjiv +hrsizvqnwmejofabguxld +edmfjzlvoinxyqprwaus +ievajdrlfkzqcstnouxwm + +dkxoaplqsbz +zdrxpfltkobywasq + +hpcniyojgsztdlub +litbsnghpojcyzdu +jdhbycapzuwgtnlsio +hbsiltzyudcpngjo + +jkbog +uvgok +vog +xgieom + +f +y +y + +zoswvb +swgbzdvot +wsrezbvoc + +gdutplihzvfocxa +zpqonktlyrucaidmfvh +tuavsxdhfozlgciebjpw + +htydg +tlg +meygtd +tqjrg + +zhugty +tzghy +ezysgth + +eirgsfbqmhoxkyj +wkhfsoeibmjgqyxr +qgokmyxeishjrfb +dfbsuriyjogeqvhxmk + +u +ubi +u +u +u + +cvseaypi +iycpve +pveiyc +ivycpe + +ojgxqrzpf +qfzrgoijxp +qojgrxfzp +gropqxjzf +jrgxfqzpo + +oswduz +ozuswd +wozusd +wosdzu + +zepyf +wpe +dep + +ptsoviyubhefwdg +eugbfwotdvspy +dabcyetvufgpos + +gvwjbspykdzoarinteh +hjrecqndygmabifp + +belwimkrtvhnzojau +nvaqblwkreohsmtcz +ovaxdmgnzbeykrtlhw +kwzorvhnbplqtema + +yskfpmjebdich +exzjvwsbipomqr +ijsbutamfheldpc + +xowyihcmreuqldkjgv +ymqlrhduocepkzijxwv +wdyljroqshcvfekbmuitxz +eiolxkjvqcwmuyhard + +rifsactz +dtrlaspjefbicozn +wfizahcvrqkts +vmtfyhqacirszg + +jgbdalcpw +putak +dzacrwop +gopadq + +scotnlhavpyjqmfgzk +ygtocpjnzfvmlkqa +qcjlytnkfozvmpag + +iu +bu +dul +u +u + +gadyx +jti + +f +f + +da +pxa + +mgbskecwd +wgcktmse +sgecmtkw +cekbwsmdg +saegcfvkwm + +jm +mj +mj +kmj +mj + +bdkzv +ftloezbkdvy +zbvxdk +bzwkdv +vkdbszu + +btkesqymhzuwcpd +tcaiwjxsg +wsct +tinwcs + +amqgrkjsv +jsgmqzakro +aksmqgjr +arkmgsqj +graqjmsk + +vwbjpyehxfrcguzlit +efskqzadontm + +t +t +t +t +t + +mnos +jdvsnfomx +aosnm + +zoh +znoh +ohf +kdhto + +zb +bzn +jzb +jzb +zbj + +jomtfxgs +nkqytilrace + +mzkberyufodx +ujnpckbhxroz +lkbxorzui +uqozrcjbkx +zorbxuik + +hklmwxyvtdcpgoq +vjgpxqaohmdlwktc +xftwhlpvkqgdmoc +xqdpotmvhfylcwgk + +ocu +cou +cou + +ijanryulhzg +ujainhlszgr +lagnhrizjk +ahnrbdgizjlv + +vdnce +dcqne +dnejc +nectd + +eifwmbdut +mdftwiube +tuinmwfdbe +mfdwitbeu + +ipsbgk +jsai + +sqtucpvhbimroydkfjxlaz +azmdqcrefjyubkwhsotpv + +ygczbjvlrnk +lgjivzc +clsgpvdzjqm +ohjvzlmcg + +savmyfxg +xeyfsmag +qmsxgyfrw +xvfkmgyahs + +ynzsbet +bsrtnzv +bdjwzhamfnqk +nzbciex +nobzgvps + +gjmaqcdiebhupywzfltvko +ktqibcuvalsmnghefyprdoj + +mvqwdhflazokj +okfqwvdmelhzaj +zvjwacmuloqiskgtdyh +flnpwzxvhqjdmroka +qzmoalwkhpvjd + +n +h +th +fsoxd + +peqynb +qepbyw +qeprby +bpqayvel +qyabpe + +sykhfvwmgnutbeadql +gtkmuflbndvwhsyeaqc +djwftvybqumneskhgal +skwtqbzrmhegulanydvfi + +fuz +fuz +uzf +uzfx +zuf + +yrpkxfnzbmgqwvsluoa +psyulngqwrazvkfxemo +pmqwxayzobklrugnfevs +xrgqnsivfpwazlkuoym +jsglfrdaqvomxypzwknu + +arm +rnhamv +tlabjmx + +rxpzbehywfuts +xruyvzwbmsef +ryebwfqgsuxz +zsrxbeuwyf + +bufrwlvodngkmxitpha +loufnmdtqrkabghxiwvep +hdutjkmafzxnrgvowpbil +kxuphaodvbirwfmtlgn + +hgdeptiafxsujklr +dskupraelhxtfivgj +tuegfxjshdkprlia + +ejsbfhcvnx +frtecbvxnjszh + +iouylrj +uojlxyri +fyuoikjlrm + +bteiydmrh +edmairhwftb + +iygeubcal +biycheplzagu + +xnpmz +ycnmzpbdq +zmnpk +pnzm +pnzm + +wzlhmaoq +wafiyomc +ptgawvoer + +tpynexdwkolrfhqj +hlnprfxoytqwdjek +qxwkortdnyfhljpe +wnqkjyfxdlohpret + +psjucnhrbefvzyl +dnwzqmauglcti +zqudiclnk + +sg +sg +gs + +phbydkeljnzaow +ajnkzbcige +eakbjrcqxnz + +sjcdoehzu +ceuoshdjz +djocseuzh + +nkxlgspidmhwzqeojv +fnhwxuiktzmjogqvdl + +doirbfxv +oxysdbufri +dboixvf +ifndxob +moixzdfbj + +dtbmegpvux +nlhcjayz +onjfrsqkw + +lqpamhfudgjtv +lgjudvhfqtpam +vtaglfumdhqpj + +z +iz +z +z + +dewlyguxtivcqb +xleqbcitgvduwy +lbtwegqkcivdxshyu + +yrxqbsonfcui +oszafcntugd + +obke +kbeo +ebok +obek +eobk + +wtoxd +odxwt +odwtx + +kndxiqheltrpacwbu +idekwaovchjpxrtbunql +builrdxnpcehtjwsqa +iuabpznqrlhfdtemycxw +ebrxiuaqpclkdwgtnh + +itvghlycjnz +hyjltiznvg +wnjzmklhvgity +bhyizgtjvnl +gnjviylzth + +jzp +uki +revlhqgayn +fsjt +biw + +yadxckevlw +wlkcvydx +xkdwvlyc + +xqsw +qsxw +sxwq +qxws +wsqxf + +dmqyrznsoifej +wyge +gktlabye + +rnyqsv +nqsrvjy + +zuw +z + +fawqurvtmopkc +kcmquvwptfoa +komcuavqtwpf +uaovkwpqfcmjt +ocmwvfupqakt + +ztlsuyribvogcpme +ouvmrltbescizypg +gmsvutbeoylricpz +zmgticyleusobprv + +pfhniyksrwcvduqogat +knfgaviyqrcusodh +rukvogciqfandsyh +fkacsgyqdoivurhn + +q +e +m + +cbr +rbc +brc +rbc +brc + +zlps +zpsl +spzl +zjlps +zlsp + +zvi +v + +skfw +sw + +tuygxsjhiczeapmbvwkqn +tenjiavpshbyckwmqzugx +gtsqkmneacvbzdjophuixw + +tbl +lsyzjmcg + +ntofwi +tnofi +itjeofn + +o +l +l + +qoaujcnksbpiwgtheryvfxmlz +anvhyiscfoekqupglxrzdtmjb +lxscnzkqofbyeuvtmrhgiapj + +rakhwzxtclnymgbsiej +rcustiyeagmnxbzkhwl +bnfrtwslzyhcexqkamig + +tbo +tbevu +bt + +zfkgeyjmuplqsrxdbwtvhconia +bremfqgkdlvsuyxazwpntocjhi +jbimlwsznaktxhvrfoygcepuqd +jaedlpixsfomuhgwqrzctbyvkn + +bqskzjafrehwu +akwsjufzebqh + +eqfmkpjztwrxhugbyn +ghrbtmfuqypexjkwnz +ebptfnqxhryujwmkzg +juzewkctxqlfmhpygbrn +tbhrgmyfxqnkuzpwej + +afqpvgjxehwdo +jgzbeafwdophvx +xkaesfvdhpjgmow +zhpuveldxwgfqjao +xjzadovrepfhgwy + +hzfwtimqxyl +wfylhxtqzmi +qtxfhzwlimy +thimxwlfyqz + +gyikxanutzjvrhod +xedlmbopwfcrtnyjsazq + +yhznowsvmiplc +lyizcvohsnxmw +nywacvmirfbzlsgh +sczlmwynivh + +xbjzeyamohuftwirpl +yqwgjurichlevfbz + +grzilwbosadunexh +zswunredgtaobkhxpl + +hpqsuokcydmwl +inewxzrg +zwvjb +wg +watr + +hdkjnms +bmdhjscnk +xsijavqmoklpf + +jelhuczo +xpojuhlbqzrt + +orkbs +cbs +mxdbij +br + +mkpna +kapn +pnak + +rpdw +pwdr + +qc +qc +cq +cq +qch + +umqepd +ceapd +xqdpelh +pukedf + +vfkdrqcbumxoian +cnwmukjvqrbodai + +tbeizdphysfxwrlaokuq +ywzaqsprukdtbheoxil +rvkieodhtqsupywxcazl +hsdiwzeqoryulpktax +axoqulrigtnwehsdkzypm + +gvfkhzwtlm +zrsmwnbuie + +zrxtwfnqod +fvloabkyirwzmn + +iltbsmy +tliybms +bylsitm + +k +g +voh +pm + +yrdneovzfghxalmspuckt +tqnikyerogxuhmfvpzla + +ylckwbrtmsjv +tkjlvcqrfea + +twjumlapesnz +pmeoazub +pmabuoez + +xmgyd +xdymg +dxygm +dgymx +gxudcvmy + +v +vw +pvd +vu +v + +qwmfrncxb +drjqglsakpwtbi diff --git a/day_6/main.cpp b/day_6/main.cpp new file mode 100644 index 0000000..fc1f836 --- /dev/null +++ b/day_6/main.cpp @@ -0,0 +1,78 @@ +#include +#include +#include +#include + + +void part1(std::ifstream &input) { + uint32_t count = 0; + std::string groupAnswers; + std::string line; + + groupAnswers = ""; + + while(std::getline(input, line)) { + if (line.empty()) { + count += groupAnswers.length(); + groupAnswers = ""; + continue; + } + + for (char c : line) { + if (groupAnswers.find_first_of(c) == std::variant_npos) { + groupAnswers += c; + } + } + } + + // Account for last entry + count += groupAnswers.length(); + + std::cout << "[P1] Count: " << count << std::endl; +} + +void part2(std::ifstream &input) { + std::unordered_map map = {}; + uint32_t count = 0; + uint32_t memberCount = 0; + std::string line; + + while (std::getline(input, line)) { + if (line.empty()) { + for (std::pair record : map) { + if (record.second == memberCount) count++; + } + + memberCount = 0; + map = {}; + continue; + } + + for (char c : line) { + uint32_t value = 0; + if (map.contains(c)) value = map.at(c); + map.insert_or_assign(c, value + 1); + } + + memberCount++; + } + + // Check for one missing? + for (std::pair record : map) { + if (record.second == memberCount) count++; + } + + std::cout << "[P2] Count: " << count << std::endl; +} + + + +int main() { + std::ifstream input { "../input.txt" }; + + part1(input); + input.clear(); + input.seekg(0); + part2(input); + return 0; +}