diff --git a/noahover/aoc23/.formatter.exs b/noahover/aoc23/.formatter.exs new file mode 100644 index 0000000..d2cda26 --- /dev/null +++ b/noahover/aoc23/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/noahover/aoc23/.gitignore b/noahover/aoc23/.gitignore new file mode 100644 index 0000000..8a762dc --- /dev/null +++ b/noahover/aoc23/.gitignore @@ -0,0 +1,26 @@ +# The directory Mix will write compiled artifacts to. +/_build/ + +# If you run "mix test --cover", coverage assets end up here. +/cover/ + +# The directory Mix downloads your dependencies sources to. +/deps/ + +# Where third-party dependencies like ExDoc output generated docs. +/doc/ + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez + +# Ignore package tarball (built via "mix hex.build"). +aoc23-*.tar + +# Temporary files, for example, from tests. +/tmp/ diff --git a/noahover/aoc23/README.md b/noahover/aoc23/README.md new file mode 100644 index 0000000..1260697 --- /dev/null +++ b/noahover/aoc23/README.md @@ -0,0 +1,21 @@ +# AdventOfCode2023 + +**TODO: Add description** + +## Installation + +If [available in Hex](https://hex.pm/docs/publish), the package can be installed +by adding `aoc23` to your list of dependencies in `mix.exs`: + +```elixir +def deps do + [ + {:aoc23, "~> 0.1.0"} + ] +end +``` + +Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) +and published on [HexDocs](https://hexdocs.pm). Once published, the docs can +be found at . + diff --git a/noahover/aoc23/input/day1.txt b/noahover/aoc23/input/day1.txt new file mode 100644 index 0000000..813c4a3 --- /dev/null +++ b/noahover/aoc23/input/day1.txt @@ -0,0 +1,1000 @@ +ninefourone1 +53sevenvvqm +kscpjfdxp895foureightckjjl1 +72fivebt9ndgq +28gtbkszmrtmnineoneightmx +four66jqrbtqcsxjtqjvfjhl1 +four8pzznjbhxlhtz6bhtzdxjlg1 +rgxjrsldrfmzq25szhbldzqhrhbjpkbjlsevenseven +slkjvk4threesevenznjqmmfive +61ppgrkmkfhteightone +1threesix67px +sxbjdbtlnjrmlzgxneightthreepmqxdxhfk8jfrheightwovp +twofour2sevenk +sevenonezknqnkfqbzffjvfivetwo94two +45xj +mp7one6eightvhfnmfive6 +fhtctftxm3threefour2b +2dq7bdmhhs92 +pdnbqlbvtcxgpnfhmsfhzstgm173 +8fourvxkddsrlcvseveneight +15zqpmsix77hlljgfive +jzjv6seven +eight1vbfive +721sixsdzbqtskbpkqbcmgmlpk5psrhr +pqxdxcx5 +twozsf2five +7twosixthree775 +7xtxrch7six +729twofourlqrxtwo +qtvbgtclhnk4ninefourseven5one +jvhngkcdjhnmqghdbqdzqssf5onegzjbbcchboneightn +five8two14five2nine1 +one3twomddthree +8nine9two +7fiveeight9ninesix6fivethree +254kcd61dc4two +7sixonetxvthntlngtwobzkbz23 +8sixnine6 +threedqtgmv2skmvcd +7ptdhpvr1 +lsvmzvzvd9mqxszjmbddkmxzdxsninedmglzlzphtwo +kgdt12seven4xxtttr5 +nrdtgdftjmfour6fxjninenineblqlthvpcx +ninezmstcdfchc11onebmmfdfhvdncrhc +1fiveseven +oneone26twoeight +threefivenine98one9twotbbcq +9cm7ninestc +jcrbmcjtrlzvz7 +nine8nine22 +3nineoneseveneight +58four2three +stwonefourthree9twonine4six5bvxgkxf +ninechzcz4seven +2tgzgmtzzpjdqqz +brsptjppb28qxcxxjbzpeighteight +eightthree3ninejrft4 +sixqsgkzdjmgpfive4threemxltqdxsfive +vxfd2q8 +khqhgqlxslkmbrvljcnineeight1gjgcqmnbdczqb8four +mvbltrgpfourcclxftbb7gcbqcptvgfsevenrdm +61eight +six8fourthree6fourseven6three +jqdfxvhjg3sflkn2sixptxxsqrfml +6jtxs +seven99threeone +five6sevensmbbrjqvdbmkbsqtwonelg +fdvfsndt32fourgllgfrninebhnzzczfive +9hxp9srhjhjjvqljhzprcjpqreightzs1 +djldhkkcn55threethreefourflnxnbzhkzmx +fourfive43chfvjnvjrkpxlgjrfnqbl +fxjgtj4 +1sevenfour2fiveeight +seven43rxxeightb1 +9sevensnxkp3lpzxfxnntkxzkrhk7jzhmtvn6 +25one +threeone7 +1pkfvsxxthreeoneseven +ztbvfqnpz2xdhgdjmgvfourtworqbxqsh47 +8four7sixninesix +threedgl88cczqhqxjnc +nineeightthree4sixfive3sixdqlmscqjk +16crjsdl +tgq2sixhc7three +tzgsqspndt5xnqlthghzfvkkhone +4fxdqrs64ninex34gd +seven22 +kghfkrpvnppfncbhhqpt55bjf +hjhb71bqdrrgsrkqdtsgrxgsscqjmtfzjkzsbp +lgdnt9threeeighteight97 +pvjhnk83sixncvgmsjltwotdmmpxknhvntfndxr +7449 +qdfzv9hkprplzkfh +66three5five4zdsfrcnljqmsxf2 +veightwo27bdbsvseveneightrcqcjxsixeight +1thvkkk +8bnxqfsdhzppblzlzbkfsksfscmb +zseventbdzlmhnnrfive1one +sixxnmntrmp6srcsqbrqnjfiveeightfive +4trnzlshnjtwo5twocxrvfssbj +6two3twonetqt +55qsnx43 +3three23tpctbkrnqv +sixqk4cnfdmtltmlhqxtwo41glkhdhgnt +35fivesevenpfournxzsbbgzthjvlvzrnine +tworkzgkcvcone53nrvgdvgtc +two9llkjbkz8pklrsgqqzr2four +ninecgpbgcnine4tldjqsone4six +2tfjhtfourfour +onebhlhdvvqx1sevenmsixsix9 +pjgjt6jkrgshxltfnine8four45 +4vsqfljrfiveqeightnvbdb +11nfslqvhm +7crrhqxsfive8ctkzbhqnine +vrvtglvthreettrkq5bdlrtpx718 +1btbxlthreedtrzgeightnineqczhqm3 +193 +fcbzxqxxjtmn47ffschdrbeight +twoh1gqkrnm1 +7ninesixpzpsn7 +5kkvzpgqd +three6nine +32fdn +22twoxgvktxpxmbjqtgtbckx +1hdtftwosix +2jfc +six5nvzcgmrscjn5eight4 +nineqhtczsninetwosix4five +9three6sj +hntktlbqmldrphqzxkhfour193 +twotwo5259 +v7six1vtlxnpm +rhsm2 +gprmtxbhlsv8onefournine +2fsrbtdvft15six1kxpqbnqsxh9 +one5onemxthree8 +nineqbxdbznzktxsmstsntzffour3one +9blhkhjsgsfgsblzdtqqfour8 +stz4889563cb +vjrbs6threeptbbmncz7hqhqgfgldtseven5 +vbfs1 +zjqgczjsjpvzvjseven4 +sixfjzbrrhcfqvglxhnsxninedrvtvjbfqjdbrzblkq6three +one3threegcdldjsrsssixonefiveonechngsl +7srxv4hsgjqsqfvv1tdngkpjrczkl4 +5scgdglnjbnsix8fivesixtjccvmkfxfnzvhctgpncjc +4eightfivefive1lgscbj7kpcr1 +eightknfssevenfive6jnpklczrpfeightwol +37qccxllhzshninebvpc8 +1eightmmcthkhf +seven8fourqn7tbgqnmzcc1 +sixsevenone4 +clhdvjnqnine9threesix +onetwoeight9 +81z3threenjsdhnqxvtwonezv +9hqtsb +onekgnlbthreeg3 +eightspnrpjb65fivevzfpvjntbg7drbgjccneight +ninerdlsix7285 +fournineninefive3vbnhmhdvjgdqcm +njzspqxpxrone7four55 +nfdhlqcpvzrrtsmzhgq3 +fourmfdtnpsfbxkjtgtgx5sixrppsqplqdjvnsixdtqvtdm +21onesix6sixnine2 +fffsmvtt8fivenineglrqrmktzzseven +fivefoursevencjxmskrqclz2 +lgk27threefourfsqrbkntbkfourvflgrzhh9 +617hj9 +ninegcxninetwohpfdxrb3tjjjtxtnvtwo +one1gnftc8onehtsxsmg +foneight3fsbhdqzr5twojbsdnntwohd9seven +zkzpfvcxqnbvrg1 +nine36cddqfvrf +rdjlpfk2pschfsdrpz +nine994three8six +three3nvflpftf2eight4 +3nine2 +rxxjdk5354 +hf4eight8qjtcfldnkvtwofivetwothree +7six3twodhnvmxj1nine +57seven3six6 +qklbvzfhclfnllhhgeight8xtvld +5fgzqhkssmkcfour1 +hhvjkdnlffnineeighttwo18twonecs +sevenbfzrgfm1six1 +nine71cskklxvcbnxtskdbqnpgklrxklcgccxjnssksrlkx +hmklhhjdthree77 +3vpxclbgkpone3ninesrclfive +djfqkgjvqpfvdsix5sixtwoeightsix +eightlt7csvgxpnslk +sevenfoureightnld2mxtgpbzpthree1 +11sevenglfmsb6 +onetjjnxvssg1four4drxbxpnpv24 +2zdxs9mfnbgfmjln1threefive +one186ltsbck +6fsbpb9sixhc +nine818 +xzqcpcdprsqjbgknkvztwo419q +39qfdlcnkhg31 +9djnlcrxqxhrcb8mczrxrm +nmb887525seven +jhmv3 +zhvdbn1fivem8seven4sixoneighttsn +6zmmjqmnftclqbcthree +6cpzeight92 +onepqfhtsevencvlfvnczhb91mmtdprqxmcnine1 +tvqdfxn8eight +five6fivercgrpbtjgv87jmcndclbk2six +jgtmrbvl68lpqkpxddqqxvsixfivesix +nine2nlffgkvmp +1frdnhssftg4eightgclxsgqtn +2sixblr94six +94mlfv +6vlqtcsmdd47hpfmlc7fiveeight2 +tklxghxv5bzc4hhcdcpmnine8 +four6one1zzgqghvs412 +xghjpblsfpg19ntpfmcfd +471rbdblzs +69fourhjxkvd7fourfour +jmrscfqdfppfdjskpk61 +five5eightnqpd9ninezknztwo +onelknchr7nrfprgmqzp +svxlxrx9892five2 +3ntkbzzpxhdmrsix8ttgp +ndh7zlnrzpvmnine +one7xlnbmjjmfv62qvqjpfprbvjkpcnine +99three5 +threetwotwo7dhtgtbchc7sixtwo +tmfxxph3eightgdccscdsrkmnhbb75 +joneight4one5 +nine3six +81tqzsqpkv99 +sixvjlq7 +five7bkc +five3811threelfpzztxzk +1fourkkpclqc3 +xgrpbmktcthree46g +bgcp4two8 +jtgeightwo7nine +bkmcrcq3eightrdtvrbglmxmmztqm +7tscmg5one2jhhbfb1 +zt5khcrgqjg5nxxzxzd +five85 +twothree1 +eightsixthreetwo6b3tnjmcqdjfive +onefrlg7 +fivescbjxbdnvslqqsone5bdbvskpmksqmmfsncsmd +two83fourthreefourseventhree +dglrmbtkfltwofive8ninelzmrxvxoneeight +8nine6sixsixtwo7 +sevennine4lbsevenkdnrhpltn +h3fiveeight4cplrnd +vhsgjbqm3ninedfhfsb +93nine7jvjmlzgcztrqlxtwo +zhhhdddbbgcssvfzdhmpone5fivefournine +l9fourvjfbqpdslkmvxsdrnsgcvzpjxm +kxlseven5two +rbtwonegsdgvsjtpnnkone7mdz +phffknvthree2threeqgvfqxgnine7 +2lgglnmthreeseven27three81 +lrgkrxx2 +seventwokxvzkvq6eightthree +5fiveseven +fstwonersngdlngx28nine +49oneninesix8four2q +hfvhzvmjgbfcbsevenrmhjhzkc3 +six84 +8eight2gzblldzvkjfive +6fz3eightzmsqb4qsbbsnthm +fcglpc2one51 +sevendqghclrpxt7pzone48two +three5one +5sevenfivebbzkjlcnxseven8fourmzqlxxgjvc +xgg8one6782 +gggtljnnsix3lkhdqzzpdtdkmjtgjddkpgx4five +qrmsfc13onevnhlbgs +nrtwonethreerbbqffzh62 +5eight81gcdbrx3rlk +mtdtxcmm2bgmqhgqrtxsn8 +onercx2 +9sixoneqgr4 +xmoneightfour2 +six85foursixninetwo +ninetwo8four8six +qchclfzq47 +khrll3two21 +seveneightnine8868four +3rmbmtbxjp12seven +3tsxgvqxmzvxbdvxtgrvdbzqbh +eight7fourjtxx +fmb4one7threekbxeightwoj +vcsevensixseven577 +2dkhlrrtrnbgzrmxm5fiveclhgn1eight +1sevenlmrbnfour17seven +three5jtbvkseightoneseven4df +fourrgqxplbpbxtsgkm7 +fourqdfxchlc371sc2 +fqxlmeighttwo1seven +zvvlftlhfthreesix6three46qkstxvdt +m74pjgccfour1four +plphq933eighteight +cdbqlhbhj3eight +4onevgdkxhz799five9fbljhpqmvk +two6qzgphxl +two1eight +onekxxghlonerqqlrs83threehvvdhsxmfour +npmsvvrdl2673 +fivejthseightsixtwo9vgrvjzbzsrxjv +eight2gqfive7mzjzpxqcvheightjfx +1bxckdpt +dngoneightbtdptfn85 +fourtwovfzgmxjseven935 +8onesix2drgjnlrxbtdlmlznine5 +five4mmpmqlttsx56ljdzldntdvthree +1nxxgtwothree22twothreenine +38eightsevennxctjfstp +8fourvhnps3onellstpnztn6kvjccmv +1bseven93eightfour +5nphkdbhxqb2pqxtkvhxq +nvvx6fourjgkdsczjv +fourxrmq78 +8tjmnvthree3ninetwo2five +p7cvtwoneq +7thbggjbznrsixonethreeninej +xdgm1crqfnklk +onehmqqgh4ninenthjonegfjmvtfgd +sevenbsqtlk9 +8seven9two9hdz29 +fbcjhzdgzdg8jgjvcrmgbcrsixnine +3bssqrj44onedqxvhkfive1 +tmmxtz5dtxbbcjlfivesix +pvfqzksgrs4khmlvtwoeightlsx +psbttsmnpninefour42fivegsixfive +sevenfiveqscr7dfxpninesix5 +xmsjddzfxftsjfq6four6eight6three +seven42 +eighteight1nineeight9 +8c +pmqljjjzvx5znxqnsfour8 +78zlpxnvsqpgmgmk +four7fsgttnrgnlslr +fourtwo3jg2 +qlz18three5lpxfjvnfppqjxh +4fiveonetthree4eight +7lzffxkxnzjrtr +three7nineone46ksnshqgdpt +8dntxkkkgdxggvhxh2onefour5gqzsqkm +tjsixonedbklrxxk2twonxdpjzb8 +mfglbrjrq93 +seven37xhsrxrvcgninexbmdrzxthreeonethree +fivegznvfztszqlhtrsslsmqq43212 +tdthjjjbkeighteightsevenpcbmpfq2 +five1eightq +three13three4vrsrrtp +cgztjgqgdths2 +dhxztfvlonetwokszrv8prdpm2 +dfkcklchjj8twonine52ppvndfcnf6 +three7ninenkxfourfive +93sixlqxctdhmvssixone +oneqbvfrvteightnineninefivethree9 +jskrtmvsrqnpvcgsmxbonecmlrjpdpc4three +crpcfour54xxgzz +9fivefhdpcqsd +fivenineclfctjninefbsh2 +fivexhrzbqpfxl8sixtwoeightllzplcpllk +zxgl5qneightsevenone +sixpdc17thxfive +1twolftpzbmnzvdlkvlsevenhdvgfrjhmthreethreeddkdvht +67twotwo71 +oneeightcgnhtdxpfnsevenoneeight13 +eightthreervd5tnj17 +ssrsmhxrsixeight3gbqggcvfqg29 +6fivecvcdxnxhxxtlzthree +fournrrsix595 +p2qchlvplzdvchkbdzzbnsix7ninefour +fourthreefourtzvlrnr9m94seven +4jxzkrfourvtjpsnrllkjcczmmqnsj4q1two +4627qlpscgpjcnine539 +two6nineeight +63five66fivethree1 +skndgzsbsntwoone1 +threerzgdxgtthree2three +953lsdgn59 +27bk +sixmfmbslpjjsixsvnqrvtxznffive5 +2ninenlgpggxm42six234 +fdzfvkjnchsevenfivethreetscllgjvrtqckfnmz3cszmt4 +7ninetlzsxjsl2nine3 +shsvptqngsevencjjthvfm9six5four +7lsrq36threevzfjc62 +two59threedxmfourjfschvqvnine +khfqjmksxhbvs8sevenhzrmjtkgm +nine2stgflmsm8fkthhhjzlszdnmkmqpnjxrfc4 +twofourthree244nine +eightvt978 +fivefiveninesixnine6513 +2lbtz19fourtshqsvblhrkhxbpfour +ptt7bntxhdvl +mskflsslvdlmndmmqmfourtczqlssnineseven5xxxkfvzd +l329eightsevenfourfivethree +rmlksxsixspp9fourhlcg +8five9q +hqoneightsix19nine6xmjbtgjzgrhmlrxq +six38 +9eight2 +3sixbzhgfcg57sixsixjtqmknd +9fchn58 +vrpftbnvonefour6 +vqgdtrvhnnxxsevenseven9eight +56vnine5rdpsnlqcbq7three +vncrjds2cmrg7 +213sixfivesix +tzclpzdsthree4sxgjvrzcrzcndnfour +4sixseven1three7 +8fbrggzmtqn8 +four79p +twonineqonemfour3dq +5fdgpmrghtksn5onesixtwo +xseightwongqqsxtwo8jslclldvnb +nine1one +9gxjrfourvhqzcxdhrtpxgtwonine +eighthfhtnvchtc7fjkrxsmhtm7rbk +thqxcfjbksix32xqrgqsqtx +6qjqql +jgcreight7eight +6onesix4threeseven +5vcv1twoeight7 +fivesthreebvjntwo9jdxghmxvl +632msc9threenineqfone +dqxfourkb4eight +6stsp3nine +566sevenpdmg +xprjdn55 +9mjtcmhjb +twoninelkjznqztbc3twolnhjhdbfxmhfr +twotczpxn6qlcfdlpnq +4ninefive +1rs44three2gzczjdgq7ssmtgjbgbb +ggmzqbkgsix4five23bftjlmbfbd +threehfcscmmlqvcjtpthree98 +7sixsixone4 +2fivefvrr9four4three +1zt1seven +9hsbthqvhhsnineone23tslqccg +sixbqvd3 +22148four3 +ninejlpbtnfive41rtzqjgfmcbncrrlnn +9sixfour +qnhfivetwofjtqtlxd7lmrlfctq864 +69dqrzhlqssgcsxtz54cpmjvrkcfiveseven +fiveqpv85frkmpgxgc +xxqsscldeightone9ngqtkf1nine +5sixgxbnnjsvhf5dgxgone7 +sixsevensqghlvkfxnfour7 +8gmgvjbfivesevennine +qj796fourone9 +rmpfsppvzdtwo4threetwotwo9 +dqvtrhm3nhtrxxccmfiveonedfzfvcghr +4threejxkhnxcxjoneightp +sevenhkpfgdgsgnvseven3m +qhrvjcnfdbqchrsvchcxfourbkhhq9six1eight +29pqnd +1oneonethree627 +5977rcr2threeeight1 +fournthpqbztrhnine64 +fjnjpgqxr86five4sixxhrtvbp2two +7sdnvlb5two +58vffgzcgx4nineoneeight3 +h1sjgqbhndbz1oneqgncmhnleightwos +gjms21 +onetwodphfznine51 +gxpl3fourzfz3 +five46 +mqsixccffmc9gqk1 +5kvxpqrrpeightthree +threefoursevenfive2dhtbrxlzzl +shhczssbltllsmntntlqfqgnnl98rm +5oneeight3vkqtwo29 +bv69fouronefourone6 +eight6five966 +4xnrtztgfgcmnmnsevensix +gmsvtnjd1sevennine4xxhqfbrjjqbglqjngttc +mdnxhhteightfive5onenineninegqjbqmfd +xonefourtwo4 +onesix61 +sjmnjhkj2892eightnine9 +nzseven39 +99nnjjzdrfsnjhthree1sevenfive +6xmggtbnblnbxdpkzblnvcvjqmhvntwoeightseven +76five6six +chdfjrlfhdzeight778 +xrvrck9five1hrvpfvkdcb7eightnine +foureighttq5sgdfourl2 +4rnbxrhhboneonefournine +5four3 +1b97eight +hlcjghlhsf32tgknm565knxqr +onecqgbgdcmlb2sixsix6nine +kxdkz3 +seven5xvhrxdm +xblqbgkqgsixvgrthreezxnzhknklxhbmgl4 +fvnkc7threethreeseven +bmbqxv24jhdg +97rfphlxvtx +4pgblonelone +ptdpllrddeight3 +9knpjzskrfd4 +twomjqdtbbvmj4shvsqrone3 +9zzh3pjsf6mhxlhm9glglfztjm +cfconeight47fivetdsmndgvsmbqjvszb +21vbqjz374 +sixeightqgfdjbhfd4oneeightone +tbccqdpz78srmcdx4six2 +643gqtvhkljxt +klfjf4qms +zrnhkhqzpczzfqsgsrtxklpbtp72 +1cnqfltrmhphg832three +twoseven5 +mxkmxlcgsixklclrkfr8638fourlrqpzgjq +nkbfkh452pthree +zvcktvd2485four88 +rfxj4 +three6jnr7 +two45rldjnmxkjphtwo7v +fivelncjffdnkzqrshvthreeh3p +ninejgrbmhrbqldeightnine6nine8one +96lvpt2djrkc5 +7seveneightthcxgthreeseven5hpfddktpj +6bvn +sixbjxtphstzgspnmkcvc952one +gmmslrndvltlthree394sevenoneightl +threenine7onefourtwojxhzvqlseveneight +5eightsix4txcczzmg +84seven +skjpkhxggsvjbprhllgjhninetwo6 +72bdpzccvone4zbdzlllnnonernlfvdpq +bvrtmzmtwonine29 +mrlvmdnlxb2814five5fjxzlhpn +lmrpf82rksix611 +tvq18oneqnmmzvtclnthree +jrbjc1zbbpqbrddt26seven1 +lxfivenmdtnhdmf98ptpxsgmgrxkmmznlk +zbmvchmxsevenddddthree2dxlddjp4 +three3onejg2fqgtjmpcgeighteight +three2two9seightfjqtwo +ninefive8sevenvnssix +3cnbxxtgmf5 +kpmjcsfrjfgzhmbpnqmlvrhbhqs8 +3vvcone64 +fvqksdsixthreexbfivetwo3 +sevenseven5 +63twoone8vhbcpmmlfive1 +4ctwo17eightsixkpvlgpj1 +rsgsnone1 +kbvxonemcqfive3eightone +ninenineone45threepvsmrtonejxmbnd +37fklnjkslqk9th9 +fiveoneq8rcgdxtwo8jfkxq6 +rgd7 +7rgkdpvp7qrb +7crtxfmslxxtcxsv +mqdnltb23fiveqcdqtonethree +8seven7 +8cqhqlhndqjznqhdbld2nspnxbj99tqqhp +onelqn7 +bvbjfour7 +ldqzhvhrbgsrrkh5j +kjsjxdcqgjztldjvxxgr9twoxfknxrrrphkdzdl8 +rvscnztblp56ljqtwompclcf +2dbtdgsevenhzctckvkvxvjljz +tvmhhxbbxvvsnlnineqsltjd92one +9twoqdmtvbxhpcthreeeight +81dvnkd87xbct +6mnxqnndcjfivefdckzmppfsevenmqvvvbnrgs +lvl3qjk5 +3fivefive +ktvsqzrf14eightmtnqbcktk5 +sevencdknznbxseventwo8rzggmvpbvlrs +hkhhrdxlml1xzbshninejzqc +eightseven23shkgzdgvvcxxfdv5 +14five1sevenxfmhtptwo3seven +47one +2three3 +f5dszzs2 +xmxffxkxpkninethree8x6seven +glzoneighteightrnjqgjznjm9 +63fznqxdfqt8 +33nine +4vrbmthreefbdzf +fourninethreesixnine9fourlvbgqhjbqncnlbjbz +two848dbvbninenine17 +pqzqgone1two +eight7lmxbhcsix +szr2fcvkljctlghhthree +sk81pxqhhhhvnjvgzfiveseven +cgqqkrz2vpdpzrthqssg7nineeight +498eightfournine +eight85onesvxnineone53 +ninevmchpkcg2 +six2shsvqfivefourtwo +mdzckfvr72cv +twotwo7onethreefourdjtgjg +tworfclmm3 +5sfvnkrmrptsix7four6kzlmclm +1onedkqgzbr89kphvc8 +5seventhree8eight9eight +kvjpgjgrcmpdscbfthreethree4mjqjnnzceightwohh +kjbmh1fdkdtznmsznvlconeznineseven +1fmgpxhxpqznqscvbszhhcmglvtnzhbbjjbzg +1mfqzkfnine5 +rrflkqslxztdlqxqkdnhqd7ps +39123thhsmscbpxr +8vnine4jgqrvqtshg3jhhdnbsrxneight4 +xkqgnfour87 +lsbnjqtzqz7ninenineone73lmkbnkhs +9fiveqqgqblfivehttxk +8twotwognd +4xknbheightfour6358 +4cqtpfjpf72eight3 +ninemjpqpqg8foureightsevenfcvpnrnnpzhcgkm +37twofivedsxrzbpchnkgxqx +oneone57one2k92 +mckoneight9threefour1onefourhdrcrvhqcmngkjnsthree +945 +tmmtwo7 +57 +6twoxzbfftnr27 +threenine4bqpztsixfour +84eight +3jpbnjrqhqfnxckqkqdvls +9gzzjzz +374nine +ninembxeight4sevent +threecq3 +cvn6cvqmpmfflkzphndjnggtktwosn +pgz7four5nineeightsixqrnfkdkgh +6one781vstwothreef +one617fourthreefourxqxnpv +8eightsqmkjkkf5xckcvd4lfnnfour +seven23qhntfmg56onexkjxh +f5s56rfltx282 +twosixninefive1tlzq +threetdhghclfsksql5oneninetwoseven +zbqzxmpb9pxlrthree +r4gxdzjnvzfonejnpmfcpgvxjjvkh8 +five338threejkk67seven +twolntxcnzvfr55sixtwofivesevennine +xhlppbqfr71brvppsixthreefddlgpfslqmdv +kxsklgonefjfpkd4threefive9six4 +6srphqmtdoneh3glthreefour8 +rjzdmj1cqvxnx1nvcvbfctft9 +3fqjdgbpggthreesix53 +9fivesndgmkvckblktzkshglqgdl4ztwoseven +qqrxkqhnzb23two34nine9 +8hrmffgstqpsixeightx1six +jngcsjnrhn2zsvcjmjg +9zfdmhzxdnfour272dcrqgk +lbjbrfhjxhxjphzxsjsix4 +fourthree2seven1two +twosix87 +vrlqqkctddggcvcjcpk6hxbqvbxmtsix +mrcgbpc6dthzqmmthreefour6two +r2zntjxgpfqfmqh +fourseven3 +6nfnsgchjdffttmgfnbvlxzoneseven8 +8sevenqqfiveseven5twojvgk +4rmtkvml4 +bprnine85 +sevenmfpcvlblcnine485fourseven4 +sevenseventhree68fivelhqgjqvcdqkvds +3fourxsgghqnvtssnvfs7nine7 +1fiveone5hpfdgvxb +eight2eight42twotwoonenine +lpdeightxcgpxkkeighthtjpsninemjlxrxtg31 +4smqpjzsixonethree +mr6csbmgrdrjj3onelqd4four1 +5sixvbscchd3 +384sps +4qzgsvmfx4ninevcclvcfrfp6tckcpvj5s +8l5glclltgcjgbhcg6 +3ldtdmjc6threeone +hsrtzl521nine5qqrtpdsp +z4v8threejdsmbfjpbj +9sixln26eightwovmh +848 +kndxtqpfrqxdxtfnqrqznpgvp9ninerlzcdvdtwo84 +kmqs84775seven +5threefourzkg +43five8cq2kprvdqrmxr1 +three4ttjqdh +48nine7sixfive +22x +sixrgtwo3rnbzkrztkdkg +4t +29bjpskmxneightppvthree +zmlzxvtlkt4seveneightbxseven +5two5eightnpszzmbkncnstx4 +9vk98sevenhznkxmlrlk7vdbqgvfjdk +1sixb8sjkvdhfld +one42eight4mrsdnpfjpvdtq +76fourntsrfllxkdfqvm6seven +skqndhr3nm4776 +4xpmfxmvj633eight +83ninecmpt +fourdthree9 +9eightjqnnmthcrseven +7threekgtf1 +xscj7threenmhsixseven5s3 +cqlzjt41 +855threemlmmqkgtfk +ninefzmvjjtvbmgf8nineninetwonegcn +ccpkzcldfourkdtfkjxvfb9fourhbtwonsoneightnl +pkeightwo5seven88rdnzzsdkbjeight9 +threen2fjsfivesix26nine +nine4rz8nine7bglpcmkqfzpseven +eight94six8dpgrv +twodfctf278 +fltqtmdkgjsvf72three +llrtzsixsix4fivetwosixone +qjhtjqjhgkjkzlpxxclsrdnzk1gbqt +sixeight1sixtwo +one5413nkmqjtlbdkz22 +bhtwoneonemzpzkqeighttwooneqkmcmsbq4 +sevensix3three2sixprcqcvm +25tjffdrtwohfqlkhzxlhb +97gcgqgjnpsthfjfdv636jsxq +zggjmjone1297six8drzs +jbpvnineeightntkkshbjvr3nshnqzdlkjmkfive +5four2gkkbxmpthreefour6 +5two15sixfivetzpg +one4fouronemfpvnqseven +9fnlbljdnzzfournine78 +djfljccrtvvqktzzvk61onesd +7twohbkeight +seven1eighttwothreet +4mdcljknhpqgxffqpj5 +nine9jlsmfgdgntwothreeeight4 +136nh +635ninejghg5 +cmone7fdlk9lfivemzvnhkcsp +8eightnlndm +6fourpb892 +fiveseventwosixfourthree7 +5fm +ninegchdnrf63431 +24sgnflnsixninenine8 +snm9 +3fntd721dhhkrqqxsfpstsvzpgonetkhcr +jlzfbml61vdmgb7one +266517 +7fivetwo2vhchmg678nine +cgrp3vzn5ninetwofour +666ninefour +9s +svpcnlktpxtvk42jhsvvdpftxpsk +2qznfzvbdr +foneb7eightfivehlbjjknninethree +kfp6 +l34pxxhxtd7d +rsbcrtwo27twocqlmeight +jkzgvqgpjfdqvmjfx2flnvjmgllxghhrbjjkfour2 +45sevengdnf59twofive +6fivespvkblrxvkcgdxktl +three9dvrssvl5eight4ftsix +seven56gdmlbfbjsl894sevencmc +814 +1one4 +onenine5fivekcrf1gvvfhlncsv +2ctvq9djzddfxcrj +ntdlcqgsixvmfvlc4fourvlhtvvqmnmkrm +9nineseven1seven +lcvzbnfourksvjqvmv47one5 +nine4blvlvlpkl6 +sixnqxrhnztzvpmbzmxjm19five +18jtzhk +rzrhv8four +2npghxvjonebchsprfhsjznrxvxnine +eightngsevencrjkxbhpgtxlzhgb46sevenqhqmlfx +threesffl9fivelgmndjfvseven92 +seven85 +87six9vnshclz +threetwo7915three +one2vkbp6rhqbxvcl7 +bsbr1five91 +qd3mnine +jjvhltxtdh5nineone6 +mbxlnj7bbhnxonejtmtqjfrzqgtrhkeightnine +fourfourqrxdtfive2smnqp +7tvjrszvrhdl5five +four15tvmpvxpvdjnine +sevenvv5tworpvdlseven3dlqvgblqtwo +nkckggninegnlqlnv25threexlhlbzvzk +3vngmhprjseventhreeeightnine +nvqtpzsszrdvttfivenine56oneseven8 +146 +fxfbone59 +f32dhffctkxp6rcngvtfq +sixthreefsixjhckmjqfive495 +42four +65nine984 +5fthreeone9twoqqsfvzmp +ttwonefive4 +one6gfxseightxqcq6 +3sixnrjtwormrncmhxeight +jhdxnmsgsdsevensqsslbsndpdmznmldbgeight3tcvjjv4 +5sixtvpckxzcjzbmrzk9 +pmdmnfgkb3six8xsmstsmxgmm +53onetvlgbglq4zbqpdgsskzdsksd6 +kzjcllvz6skphkfdxfiveqrbhmk +75qqjdgxlmfthreevzbfjdlxkfqqq +seveneightjntpjthzptwo2two +2five4fvrfxxnine4qzkkfkmq +2xlvcltn7 +fnmggtj2rqxzh7three +rzpjkgtml1 +2oneseven4one7xps6 +rljfhfrhmzkjxktnszbkpfspxdkqneight2 +pzgnine49six2 +plxsqeight2 +eight2sevenseveneight8rfcrsdlxb +sevenclpqqfxgjnmtwo9 +9sevenrqsixone8eightrxqgfsbjh +kqtkstrxhtfzbllhl4lqvqkcbr +hfplfpbltczflpp7nfive8 +ninenvqfrvtwo6onel +threev65 +frhn18six9sixninefourrsqzgd +mcxckfg5vpkbs89gbninexjzvlj +fivesixdx28 +7ppbqv +hs9twopcvpgtjnrsvksskpc8 +9mlpckzj2twothreefive +rkrgdclkninetwo6eighttwodc25 +tfivefourtwohkhhgsqlj1dtdcxmxkf +1four6five +fgbvmvxvtsix2twonine2sixfour +foureight66 +s6fourcv +mxl358sixfive8six8 +ztbtwo73sixvxsix9four +eight7qmdlcxfive5 +phgfivekrjxdmnzsqsix9 +1mfqsevenhz +rjhcdgzngtc155bqlttbsxklpknvlmk +qjkdqlrrs6two +sxlmqzxdpxdnj9fivetwo9seven5 +2qtdblb2 +8qgdzrsixtwo598oneightp +1shdb944 +vrlpronek2 +jm52 +8eightfourseven11mvtrmtkr2bmp +mnvnjxrgmrxhztwo2ssrdpqk +ztfive435three6threetwo +tnrrdnbgnbhzljdxhxxfrqkcpeight8js3 +foursix6zcsrztvgjxmp +five7fourgnnkspxcmczcbgsbdf77five +fgbrzkmvgrdbqjqndpfive81onetwomtzlfb +2qbsfd1two3ninetwo2 +8tdjxvfpvdvone33three +lpchnmln56twofive8tfour +cfkfbhppjf6fourdkfxsvdtbcjspzlseven8 +5fivestgkzsevenonedkhhrkthree +37nine8six8onefhvvbkmgdfgtv +26hzz +5glvnsztmnfjmkjseventdm4five +pvnnqrqvftrbcvnnthreenine5 +mgscxxlp3eight +53eighteight +two1oneqlcdkbddfour +jbll3 +8threeseven5tmtrgdhqxd +8twonine6s1 +91seven5pmqrjlhqrtzs +jj3sevensix4482 +jeightwo7lk4three +zchchxmsctzffivefournine9sqhqkgfour +72xct1 +vnsxvsqkhpfvgdseven23gzcmltzgone +xzjqhcvsix1fivecjtxnfivekmvjdc +zdfourgjlhtwo24d5klkpdgqbz +7sdzzdbrxbtonerjcmknnql4dfzqccvqt +tncqzxjq9twofiveqkxdrxrpj894six +dddmkctrzlpfmsszeight8zvbpmpkg +three23ckjhgjc +375jzdhnfcfr19mhsbnplqh +vpbbjlzone5sevenseven33four +onejzfsevenrbskjq1four +seven13one +vcnkfgv979one6zln +rqlxzzbmjb4lmbthreektqsdcfzbmdsfivethreenrxdlkqt +qkoneight8 +5rfourfivenine94fdprsix +onexonelzdh2lcbqpzq6 +six6v +7gtgxqnnine +tsljzhntwo3fourpbjncgmvf3fflvjxp +vfkdone9fivecftvmjdk +xc5three6eight94 +18363one7 +8fiveksshdlfmzhljhcmjrn7kpv5j +xbhmxfhbjnjzmninethree7 +2933mkmdqjcl +6ncvzqxfvgfive +lnine5fivetb4qmfktnqjxs +93187 +5mqninedzkfhbk +two7eightntdbsix298four +sixone3bspxqxggkmkrbcqrhfrxrlgjrlvfl96 +fourfivehqls3nine +threedfklszn2threeqzhh7one +mqmftzglone6kjpgglznhrjz89 +146cvkftscqsevensixnine +nndhdgpd484hxdgjtfsdxxg9 +6mbzckbjphg +eight6jbjtnld2mdjtd +zjtzcqxb736five +jlkdmone8 +gvjnjvmlfvcmvnfb8xcgjcmjqvz1bzcctvsixfzqjlhfkfk6 +vr6onejnjmrrldnsixsix5six +ninembtmtkgbctlfive45cjzzrmgcscfbcgeight +2mdvneightjzgffivefive4 +hmdnbxghxjxt4czshmsfzc +61six18threehrcj +six3five6eightkdfzhxcjkdhq3 +jrhqrqkpd4hsixdsbjdpscclmnnhknqq16 +jflzcxr3three +threefourghvgsktkc93cmjmsgh8one6 +96fivesevenslklhsfmpz +jgkpgfnnbq2pmspdfhsqxfour +g4fourthreerpkdhjhlxlzvnineseven +xkxhkphnkvpdnlncn86srxthree +7sixsevenrfour +5zr72qltsrbdsv +ninervqzdfzqmf6five +8jslpvs73 +ztvlxndlm5twohdhmtrdnhbzdrxb +seven6nine4dpdpvrtrmqvql +jfz1 +5nineeight5onefivecxtqbsdtbthreefour +fourgeight6threeszgseventwo9 +sixfour3 +npl8 +tzjkffsvbjseven5rhmlxonezlx +5dhtpfour +twothreebxtfndvdnine1sixbb9 +five9nineqlzrmtgs5 +9v764nineeight +five4eightlsix6 +3nineeight21 +foureight8btsc +3xgdgtb2 +7threetwonexqk +kkqsix48onefourhlsh8 +onekgtdzgfh2fivenine2onerb +six4zgcnlhmltrxp5xphvtwo9 +eight7cdqggpssix +niner9pzmrbqldkljmgphrrgmdjseven6 +439 +twofoursixrthree5bxppnhqtx +bmpnt3 +fivepkzkzpghrptpksevenseven83two1 +9fiveone8one +fiveseven3lqxghdlskbltrzrstwo +fournine3ninephlghonetwoeightbvmdcconeightq +three2pvklmzqjfh4sixonedrctlsfdfour +three91spjlscscjcxbbpdhrg37 +57qqjpdfppsix1qxrh5mlmncf +4nfone5eight +eightqsix7one +4jtvxfd38hnrmqkbnvfxpp +qmfsspkfour1plmslcrsseventhree +fzckcbfvxbpsix7nine +fzrj4 +4threeqntnineqstzjftnine +tkrh6sixdqflrvtmzmfiveseven9ktmtvprkxhfour +nine4983four +mpllmjrfgv66five3kvhthplrtwo7nkklb +9ngvdjddqbz +5twosix8lbhmzrg +eightsbmcfgm76two4hhc6 +seventwosevenrpm6threeeightwodxs +xkbseventwotwogmkxhpmhm42hvvbfchreight +gcqeightwosix8xdlhrnnbkmsevenqdbrjghz +458ninextfjxvgsq5fltdsk6 +rlgsflhxqd5bdbhclmrthree +twothreemqqbzjn88blvqxbseven +rqrrdrmlfsixfive6 +eight959tzxkgqjd +txdszrn5eight3cqeight1brqr +45122 +jvvslnkdk6qnfzjzvseight55eight +4twoeightgrhhkrvtkrzpfive7seven +three8gsmkpzsmfvf2 +fiveeight5sevenone9twoseven +4seightjjdkdglspz3vg +sevenssrzkspld2 +qnzcvcthrsgjlnzxmxlppjdpnine8seven7 +eight7xhvkrcr +two2tdjdfbqtqxrs119r diff --git a/noahover/aoc23/input/day1_example.txt b/noahover/aoc23/input/day1_example.txt new file mode 100644 index 0000000..7bbc69a --- /dev/null +++ b/noahover/aoc23/input/day1_example.txt @@ -0,0 +1,4 @@ +1abc2 +pqr3stu8vwx +a1b2c3d4e5f +treb7uchet diff --git a/noahover/aoc23/lib/day1.ex b/noahover/aoc23/lib/day1.ex new file mode 100644 index 0000000..567eb94 --- /dev/null +++ b/noahover/aoc23/lib/day1.ex @@ -0,0 +1,33 @@ +defmodule Day1 do + @moduledoc """ + Advent of Code 2023 Day 1 + """ + + def parse_input(input) do + input + |> String.split("\n", trim: true) + |> Enum.map(fn x -> + x + |> String.to_charlist() + |> Enum.map(fn x -> x - 48 end) + |> Enum.filter(fn x -> x >= 0 && x <= 9 end) + end) + end + + @doc """ + Day 1 Part 1 + + Sum the calibration values which are the first numeral in each line + as the first digit and the last numeral in each line as the second digit. + """ + def sum_calibration_values(digits) do + digits + |> Enum.map(fn x -> + first_digit = hd(x) + last_digit = List.last(x) + + first_digit * 10 + last_digit + end) + |> Enum.sum() + end +end diff --git a/noahover/aoc23/mix.exs b/noahover/aoc23/mix.exs new file mode 100644 index 0000000..9305ae2 --- /dev/null +++ b/noahover/aoc23/mix.exs @@ -0,0 +1,28 @@ +defmodule AdventOfCode2023.MixProject do + use Mix.Project + + def project do + [ + app: :aoc23, + version: "0.1.0", + elixir: "~> 1.14", + start_permanent: Mix.env() == :prod, + deps: deps() + ] + end + + # Run "mix help compile.app" to learn about applications. + def application do + [ + extra_applications: [:logger] + ] + end + + # Run "mix help deps" to learn about dependencies. + defp deps do + [ + # {:dep_from_hexpm, "~> 0.3.0"}, + # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} + ] + end +end diff --git a/noahover/aoc23/test/day1_test.exs b/noahover/aoc23/test/day1_test.exs new file mode 100644 index 0000000..2ff3bb9 --- /dev/null +++ b/noahover/aoc23/test/day1_test.exs @@ -0,0 +1,24 @@ +defmodule Day1Test do + use ExUnit.Case + doctest Day1 + + import Day1 + + test "day 1 part 1 example - sum calibration values" do + answer = + File.read!("input/day1_example.txt") + |> parse_input() + |> sum_calibration_values() + + assert answer == 142 + end + + test "day 1 part 1 - sum calibration values" do + answer = + File.read!("input/day1.txt") + |> parse_input() + |> sum_calibration_values() + + assert answer == 54450 + end +end diff --git a/noahover/aoc23/test/test_helper.exs b/noahover/aoc23/test/test_helper.exs new file mode 100644 index 0000000..869559e --- /dev/null +++ b/noahover/aoc23/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start()