commit f374eceb3213c5238ab1b15c71e50e6036bc35b0 Author: ari melody Date: Sat Dec 2 13:06:07 2023 +0000 day 1 (incomplete) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..abdb47f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +day*/target +.DS_Store diff --git a/day1-trebuchet/Cargo.lock b/day1-trebuchet/Cargo.lock new file mode 100644 index 0000000..10709f7 --- /dev/null +++ b/day1-trebuchet/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "day1-trebuchet" +version = "0.1.0" diff --git a/day1-trebuchet/Cargo.toml b/day1-trebuchet/Cargo.toml new file mode 100644 index 0000000..786ebab --- /dev/null +++ b/day1-trebuchet/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "day1-trebuchet" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/day1-trebuchet/input b/day1-trebuchet/input new file mode 100644 index 0000000..c42e3f9 --- /dev/null +++ b/day1-trebuchet/input @@ -0,0 +1,1000 @@ +eightfivesssxxmgthreethreeone1sevenhnz +hzdlftdtfqfdbxgsix9onetwo13 +29threelgxljfhrjr +pxvmbjprllmbfpzjxsvhc5 +seven2jtgjltvzbcdnjtsfiveonebhkzld +twothreesixeight6eight6 +nptjqqxoneninert1927 +7beighttwob +6onesix +6fourfive97 +jxcgpx5ninemsqqfmkpnj +jsdkqjbgx1gz5 +9fourxxmdqmmlrbpqgznone8lvtxftmfpseven +qsdzrx6 +khone9fivefive2 +nine9eightseven +threefour3pzzxmrmvpn6sixmfckm +twoseventwohncgscdmbsdzh6zckqbvml +six5nine5jlhthreefive +7onesztpkqmjlfourhrrcf3threeone +83zgthreethreenine +ninevgvrhtsrrnbnxg2fourvlqkdqxxqcmfqbbmx3 +mqphlgz8sghhvsevenpblfrmxvsixcqpsdjvs +fourlltktxt93brbmpml8 +mqfkvscjj56 +fivehhh8four17fbqxtksseven +5rbzgfournplgvtsixbqvmd +sevenflknr33qtwosixstmsblmrzczdqflxg +dblfhbt7sevenninesix2threethree +81fourtwo +three87tgz3 +bkjnnzsjgmfive4vsvh +threeqkrsbzzjbmkjdmthree1ninethree7 +5oneqdzzpj +5fourlfrp +ninefbfhptcqql1f5eightfncmrvkff +mlhxgnxxxrr3ninefnlcdlvseven +sixfiveone5 +sevensixtwofivenine17vkshzpbkbhtssg +5seventvzqcjfzj4 +6eightspklnbxqcdshsdhgq8eightninej +eight3fiveninefivemtxm9eightwot +lsxlqlnsevenpstsbbzpkhphrkjdd42fbxqdmc7six +fr2dllkdtqfh3hgvf +cqjeightwothree9hvrmtg +74cxeight +seven8fivescftvkmvxh66rkcfqfjf8 +4twothree +six4onedhsevencngfntnsss8 +8262sixthreepxvgpqf4two +8qtthree +three6gqfcml3zfxhfsvr +jltxcptthjsixmszdqt9xkbg89 +zheightwotwo5threeqrgbr +1sevenpvgqtrtjfqtvklnt +1vspr99lvvn9mktnjv +lrj8lltb5three +ninevjmsfkqkns2 +1fiveeightmh2 +lck76 +gjkmgqhnvgnine7 +55jjzqxhtmmsevenseven2ffzqz3 +3eightfive +eightthreedpxcbsjbfive3cjfm +eightpvhqkkxfdfhg6three +lsevennxnkgthree35jg7one +3eightzdkkqgjvbz926 +nineninenine49five +lvgxbch8nnnlpbvtgpqqmmm +d2sevenjqbjbklssrrtr1eight +one4xxdbgfjzhdbmxqtfvbplmsxonekq2 +eight4fourfive +threec2twothree8 +ninefive7 +1sevenmvdgzdtwoone +4mmbddbxnb +tvfjz5htfnlbzmb85thtsix +24567 +zmkckdxpsixfivezhsxnqvcj3 +nine15nine1three5 +nineckmvzlctpk3nine3vsnpvkzsnx29 +7nqthreetwo +dkdgtzxz8 +sevenljjldccxhgxs6jbblhmtxkc3kqfnntgzbvcd +one99 +twoxvns165gfclnxrthree +soneightninetwo161vhmf +four494 +23xmxbxxrhgxthreebqjzx21one +two361 +qlzchlkb1six6 +sfmzztmtkd46sixpk6sevenjft +x1vzgnpdjtwonert +575khkzl +txlpc39hlcmlnxmb9nineptdsvhdhbz +eighttwo5 +76six4blfmlclrcj4one +fiveone4nssevenfiveninefvmv3 +kpltvpmfljxfhx53seven +7five1vxdhnvrjs +fivefoursevenone4sevenninefive +sevenfnmvbleightsixsevenxgzhnrdjkj8two7 +2twoone78seven +zbfczseven8jqqksl5 +sevennine1cvr12pxfdninejqzmrklrpd +three22fourbnfdtfghmrone +kphxprbrsevenjp7 +z973 +t3sixtwonedmj +four6hqntpmsix5four +nl71 +fourseven8sixqmjrbh3xmrmjvdkfourgvlnlq +dprxplthreezsnmqcfcz6fourninesevenbc +9threeseven1ninetmjgxqthhmfvkspznz +85eightsevenmnvmnvlvlqsixzrxnrflmnthree +4threeqpkztjv82four +onemrxrxfcgtwozmnglpsixgvprxd5khnmqbdf4 +sixsixsixxcmtfh3 +7zclrbhnpzlkkdlsgvk1sixxdvlfqp +5nineslhvxhn74 +7eightninefivenine5qmknztrm +hnbsgslpvjzfourk3 +1threemlxzdfjdtn5d +seveneight94frlpvqzrd +74tztnlxvr +xrsrhbjthreetgsix1fourbbrvkcdj +seveneightjxzjgtrtwof983four +voneightcqkcdvhxh4eight +36fzdqdnfvfoureight7six +szbrxngs8 +five6fnrkr4 +sixmf5twojhxgmphxrnxxknqsqqptc +1tmvhvfkhjsix +3sevenfqmnine +eight1sevenone +seventwo371bcct +62rcxzfivemshhfourxg +fnzhqklm3 +sixkp13 +1ksqxljtftwo +2ksjstft44fivenine6bgrnzxprvk +hpdjlcstgpqzmxrth25ninelxvrzd6 +vzhhfczjs3two +three65sixfour19 +3dmfxckkdrclzhvcsfkbl8five +rjscjrshbdhk1tclpsrbtgg8sixbjgtwo +7sevenseven +9qzbqxmqonefiveknrnzpxoneightrq +4btqghfcqx25fivetwo95oneightxf +8fivejvbvftzhcxlxhqfour +sevenfourzrxxft9twoninethree4 +eight9k +39zzfckvfknjsggxdlthreenine +three7pcdnvb +sgrcmfour1tzmdrkp +eightqfkmrzpbxr19 +q36six9 +eightkhcrhkq7nine2pbfnjb +52cldhzmfoursevenxjptnbfivemdvkp +3rts +six8clzsndmqncvtbjtjzlzv8crm3 +ffnqkrrrjfive2three17 +two8nbmvvvrqxqnhhj +9hlgsngnm +117qncndfc2rjvlhrljfxljrzjdnine4 +3gvx5 +4eightsix9vqq9three +mgeightwo8zcvfghnlth7btq6brhseven +nineb5six9fiverhpgdkjvmgsrbone +sevenmmjsrhqvfour1rhvsvtgtkxxhklnqzp +fourrs33sfrtj +7threeeightninezhbvcnpmst28 +bdffmszjmpqvz9five1eightthree +lbjfg9twozpmmbfxj7gpzpgh +26sevenzdrghllpnkbtvkrfpg +tcmgzjk2rv9lblsf +8five9six4seven +94two +8sevenbbqj2 +three2vldmbjdfthree5 +threethreetwo9six35 +8j24fiveqcprqmnkcb +eight7bnghgcjxdpmcqgjks8 +tbrrggrpzrjqxbgcs5 +6eightfoureightthreenxfmdrthree2 +9seventwoqndtmhrxvssixscsjkjd +3s6xztbkmmninegfnjz6seven5 +5one21lkv +465six4nhx3 +92cffdkftleight779 +eightninefivesixhfkfz3 +bgoneightkhgvqbfivefour1seven +rxbeight47eightthree7 +fourqjftdzjr327twopsgdfgvjdlk +5fourfourfournzvrteightthreekkszfknj +six58jns7 +cdmfngp9sixseven +twojkszvbeight2kzpxvmlmblgzphrpm +threesixthreeljeightseven4 +seveneightfive4bnttggznlnn +tfz7jpmcdlvsjh6 +31eighteight23gbgsevenznz +threetlzd3five4 +34fournkzcvkkb8pjvxnh6 +mkcdj3onefive5gone +sevengtgdpdh4 +q7377five9four +eightj481 +48sevensixfoureightwodx +sixkqtzzreight6seven8xtksj6rdllzmnb +p6jsxflvtpseven9 +9two8 +six7zdjgrdvgdtgksncbrxdmhzkxjtmv452 +83eightljzgv +697five +2three6five9 +53fourthreekvpjqxhjzdtwosevengsnfd7 +nine7hnhczxpqmxpvnrtrtl2threeseven4five +7knlqbhnineeight767 +eightj7threess3five8 +4five4three +fourjnkspcjv2threeone1ntmbblkcxgvtvjk +cfbpfkxfeighttwo3seven +7qcnb +3dppxtmnqggxbrdg5twoeightnine +ninenine49foureight +fivesixfive7 +7eightsixlmj +five2sbxf15 +onetmkkxv363knine +2spgn +hhtqxplnxconeninenine5sixxqgrjccpb3four +1gstcjk3 +eighttwosevennine4gdxqbslpsdm9 +29onetfhcfive +sevenvthreecclcfjtmdplbvhxhb7 +1sq2 +qceighttwo8qcdeightnine +xhbctnhk5lnxrmldqqndvcxvvshsrvrvpcczc +sevenzjmllngfnjbrkgc6 +twojtf6 +ccqrlcgeightsevensix25 +eightzkfbst2threeseven +sevenqdcnpcqbfoneflpzjkpfkmnine8 +6gkvmlrheight +bndmmzfiveonenttqzftp3fivemchdfr +99jcnkfks9vxtqltmxsvkjlnrfive4 +c51seven2 +eight8777one +4qpgjthreelrjrzdmjsrrchkheightcngp1 +jztwo3four54tngzbftvhtwojbznxhbdb +five8nine4sixxdhcnsghx7three +57oneninehpqpzvjbjb +fivenine7sixskmmzmzpml +tvoneight3xtbvffvthreezcbrgk85eightsixbdgqspftkr +zvqvpxjgbhd6npheight52nine +1dvs +6eightvhfnlv5nnljzsggseven2tsvsmqsxfm3 +four7rckdrdf71 +5bgfc4rnptrzx +two8onesix +m8one4foursix +8124six +97eighttwodqqmpdhxlvvtxxggfour +eightnine58zggqsjqszpxonevkmstfg +tpbrdr8fnxg8threektbjfltwo7 +25fivefrl6tkhcjninezp +4seven8635 +n9two6bxoneeight +vpkqpbg8g +7fjkhndseventwotwonine8four +zm58lgzzgtjfourlxnmbpthreetwo +5gtjxtqhpkqfour4 +9fnone7sixsevenzqtndjeight +333threeninetwodxsqtvgvjz +threejpfkkgcthree2eightmhfgrnine +t7five9bzgxh5rcjxt +two6two4six911mszcfbmbkn +nh76sixninefourone7 +2fhbglnppmsixdpvzf4four79six +two765slgxvmdht +nbfjvhfxx26clnvc +blhmsixceight9zchkdzgj1pkgjt +hjbdbkjjcgxxtfrhng37sevenxcvlnszxz +vdzzrpbc67sixdvmmjlcxf +ponefourfour4 +sevennsxpzdpms1twofivethreednfive +4eightrncxsvpfftrhqmlnine +15qhpvsevensixoneightt +nine5onepphninefoursixqj +srbsfourone5 +59threep5sixseven8 +five32eight5eight +9threelxrzmnhfxqlsnpttdtn29vmcbflsrtj +21five9 +jtwonentpp8tbzdgcbzjj35nine9jfnpgdpr6 +7fiveeightoneightvs +sixfive53two8 +16onesixfivexxzmthsconepjpl +7threetwofoureightnrfskqshmgqzsgkht7 +3cprgg +sixmgxfsfcg2qmrcvj1 +86dth59xkclmzsmpvv +pbtqqfsqgxfiveqqgtfxk61kone1 +jcvmbflcqvd5seven4eighthtx +four1sixbcmbdhprf +bdgkrgkrtj7231ktxnthreesevenrhvdmdt +9cvsmgzprlk +zbkzpjh47htcplzrxfourfive +four88one4 +47sixtdfkv +onesixg935nzsnxqspfqdrd +7hmfivefivesevenjdjpfive +72rqc76jmvr +1two4 +six6four +nine4nineseven5bdkm +twojkdkrt1twosixtm3gjcdqnf +two22 +xbfzg57159 +rnfd7fpvbjgg8 +glpgbksgc85fivethree3eightfour +threefive36tzrdfourpfsqzmh +seven1nineckpznbsevenone +fivegpgsvvtvoneseven3two +threesixqnxjgzjtdn9xgtkq +6fiversgtwo +43eight92 +2onethree6 +5three55bshbhfjfqclkvhdhmbdqjlqnnskkmxl +cthdhxxjvzdfnthreemghlvt4threeb +44mcvpleighteightbtbvqfvf8lnbstqrcbz +5542727zkslrpth +7sevenninetprljfmfdjdk1fourone +fourninesix91phfzbmzx +vjdjdbckqktwoctwo3three9seven2 +bmeightwosevengxnkccpppmseven1fivethreethree +njxtrd7nl3xxjmrzrk82xqhllvt +4bndqkqlfheighttwoqrsqscggksff6ngnvfdzztqq +dqhxhdthree7one2one +8nine329tqr +mfmgpxmdnpthree8two1 +frnbxnsfivetwo2 +pbrljz8pbppkhfqtkmpgqrfivexpxvfmngzzhs +1kmrjljlpszkfhxxxkfour2eight +threeseven6twothreeqzbhqpqjlzqxpvb +6threeqmlpxbnqnfivefvdlsxlmsph +nqkvvpsix3cqdnfpxzgnnt +four8three3dthgjm44 +2qhgmgbnsjlsqsmxq8eight7nzbjthreefour +8lhlpbpzszdckgcsfbone +4tqddpdjhg661onetqmqzsrnjqt +86eighteightonefzjrbgvtftmzvxrfmxmfp2 +jqbfjxpn5sixeighteightthree33 +ninetwo93zczhjtxfcz +stn83dthgbrpxdb +sixsrzsdrtkdqmrnmjz186four +43nine78rchxzd8 +851lhp +5mqgcc +threejsix1kjrseven7one +gqtqktdzltwojlldjfxfqqzss61two +pj6llpzkvjxccrxkpfjdlmcqcknstdgkcgpvtc +2sixsix26ffpghkdz +36nhgntqjnsixeightzrzslheighttwo7 +9sevennine2 +nine23phtznthree +gmqfzxqrgvdsdfs5 +onefiveqgksmnone2 +fivesixxbzzdnxg4fivesixglvqlfvfc +7fivesevenmmlnftf392vngtrkcgxj +7fourfnqthreefiveonefdjrsqbrtqqfpqppfndfnrg +eight3gnrskgn +two3eight +173xr6 +zkqfivesdflnvhmm4three6eighteightqctcnm +four64vrtktbbchfssz +2xjnqrzrrsixsix +58sevenvgcplhtndx9seven74nine +jzqtshfcjrlkfive3twoeight8eight2 +threepxmtonemccbhpljtgsmvqmqpnhkgxmd22 +1nn1eightseven +xztfgc3twofive2seveneight7 +lxgbm2ninemcss +frkkkkvlhdnbbtvbjtjbtpcpvjkkmfourmvthreeeight3 +fcztz33fsqllqt141 +qbjeightwo6bjgjdgrqqmkgninethree +zk793vvsvgkxvpkmqkrgccbvmprl +fivesix93 +58pdmclsncs3 +7ceighteightonethreefiveseven +6mfkz249fivebclxg +8eightvvzdt6gcsqlxrtdbmqhpdjjskeight +onesnine1 +onevhhqxbnqsr37twoonefour +seven932zjfhplnrc1fivefive +8jtchfqrdhnsn +sixninefour6lpmmhmzlbtvtrpxsjlldvqj9qvdsfdzft +cfour34542 +hdhkgdqcnt5nine87dxbhctgqxphrdpcv2xzrdljqt +75vplkxcgrsix3bxdkrncdkt +nsj288636htbthree +8sevenseven +58five16eight8 +six95four44 +rbxeightwo6sevenplbhnbctqzcpcvmp7xrtwo6eight +jsjtkmz6 +nine8six2ninenq8nstthr +eightddsckkqlls23 +2ch2gbxvkqrfflqcdfxdfour +nrmmjfxsmcddk7onepcpdfkvjvhdhxsevensix +five6snkgvkzlkh +fivesevenfour9jslninesevenjtttt7oneightssr +8five1jjdtpx +eightsixrkthjm8281 +six242 +eighttggfourctdjmb7fivethreeh +sevenfive88sfgczpncmx +jtxxcsfmvfrdsgzqjdjxxgsrfnm9fivenine +seven48onefbbbpdhj5sixbgvfzpnp +fiveonenkksknhtcpsevenrxn7 +ztv7onenldv9nine +nineoneeight719 +tzpfllbninemsixfive61three +2cbmdzdzhnnx +tnpthreelvczcqhsflseven4msfzzltvmnprlq4 +8twofour3twokbvfkgfpq +eightgtpfsqcqtwo9 +htmvcztjsq5five3xjlbmmxvlnv +fourp89 +4tdxjtl7fmhlqfvkz +pxqg2 +45zzsevenninevpbtlqsix1 +2threedrmgj98one +35ninenine +snjqxsgqvn3sevensevenbm3ptpfive4 +9onevmfdlrzninethreebdr3qpvtqp +1eight6fivedtmxsrqkg496lbkvsmz +48vkmdsqhpzjghhsonethreethreezgfgvclhg +vnkvrxpmkvfour3 +ninexdtwogzjbltfours6lpkdj +n7rzskk61zqk39 +5fourcjnzfp521 +rcdbsqtmhgnfjfjxdskeightckpp8five +kvbsevengxmlncszddnmhzkpxlxr2nmkhm9eight5 +5gssevenqhmxmnv4 +nppqflmknine7 +vxkprrkfgsevenmfxjmnsevenkrzzlbshc6rzb +663fourfourkzpmzkzfour +3946sixninepvf4two +5qpkcgpmp6vrqtcqvsqbmmvrjtzkbtrftnine +fnbcn53zrn1eight +qtwone4dffhkjhjrqtwotwo +rgdz3rgqlzljxnpqntvzz +fivefour852eightwosx +8129rshnpjoneqrf +1hnrgkptsp74fdpvp +sixfoursevenone42threedcbm +four9lbkpjdrfznine29two +five2pdzldgrcrfzhrv2rzsfgmx25 +5nineqccvxgsshonesixlh2kgx +eightjzfncrxvlxeighteight9eighttmc +n29onesevensevenqxqnthree +6dcmxbqjtcheight84 +88jcsltgmbntwo4cxmfourone +1four4two6six5 +oneprptq6mfnfnm +4fdvvlk5nineone +one8288 +pxsvfzxd1 +six3gtlqvsix4zrbvfpsxjs +nlctwone5fivexspzrtm +five9nmzjsvntxct +threexzpxdtdfive6sixldddpxmxbmghmpdbd +sixsix1onesix8ninenineone +eight56jldskgmsjbnine159 +27one +eighttwo93sixfivesmgqfzspxvkztzxssseven +seven99mnnsbhxsrzvnhsvdmbpzqqdscl6 +ninetwothree2 +fourtrkdhszg4pjh2goneone +six6three5ninezpvc +79qcrtm8fivex5three +ljtwonefivesjninetpzhsbfxthree2vknbffmq7d +fivesix3 +95threebfxqrj72 +vqkhzxhthv4hdrprgsxjp +fiveprmznltwo7 +62c53fourtwo9prxbqhjf +one3zndsclzslt71bftv +2mjtbmnkjspsix952mk +34nine +gtrcfour7threevzmvlvhpf6 +lx5seventvzxlng +2kdlxgrdlqlfivecvccqxpjr +tmsqtqszspnskbmcsevenllstfh4ztn +eightlninemr5 +6one1jlplpzppt6 +7cvmrrclkfcfiveeightxrvhqqsjbblglt7one +cpvpftjrgj5jc +koneightkk7dbtkdmmbf +2krk842mbqnpthree +three7three +one3nineseven +4ssskfrfqhz9eightfour37oneightjm +jgjsfouronetwoseven6 +bkcninekjtwo1two +5two8onetwo +keightwosevenzsxpsgrzsone4 +jcmbkmpfourthreefivepvhkbtpqln9 +4vcprm7 +7qckxksgfbk6four5onesqfxzxm +5ninesevenfour5six24 +7sixfourthree +6eight58ptdrvgqlbc +nine8sxdbrvgxv +threebhnb6threebjbjxcq +threecbdtbftvcv4sevenfour3 +onehfvsd24 +ninevgbshtbprzfourqmclssgtrseven8zsgnqd +vrbcbsjdqzbjztmphk5 +25sixjrjqgl5fivekhtxstwovgxzfpvzfmoneightb +44bbpdhhvnptwoone29 +8eight78four +gcfiveninezjnjzqfourthreelggdhvgj4 +lfgsctldtkfdlbsskc99gbvjd1eight +xftwojgjsctwoptwonj9 +xnnm4sbx8 +seven986hkfone7 +65rdlfdxjeightwox +26fourclxlrcxjpkjvdhfseventworqsfnhmnnq +nineninexrk2twovdn6 +onesspsrctxsfn6ninesix7 +5c382ktrlsdlthree5jm +eight5one2 +fxzjcbznjj4sbb +cndp3 +blztpftbr3fiveckzgninebkms +td6 +one3sixfivevrvrnzzzq +8sixfivenzmnlts +one4fivelrlhonenbdfb +1twofivenine7 +four9ninetwothree8three6 +foureightfoursix2fivepkgzgmbbbc +rfftwonekccnsn28btwosixk +threetwo1foneeight +bzrzgbzdm23 +onefgqfzjnine2dvqzn +xgbjxnh1jtt +67ninedczm +ninercxgj4txpflzvhgtwoneqh +8four9cxdrdzrkn55djgbchdxgn +49seven7threeeightwokr +sevenone7qtxp76 +391two87five7 +dtpzlzxkntcvzjsevensixvflshlqxbnxtmfjnr7 +kkzkpdztb868nine3p +rxeightwomvsnt5 +85jkzsrtszdgxssm3eight2fourfour +jpjbkglsevenrhjrvl9svmcgshll +onetwonine4noneightvk +nine5vnlone +44hqbb4 +1seventwonfbmllcfnfivesixfourfour8 +5four4rjjlxhcvtwo82 +eightcjksmqq9rvshzgjbnmffbz +onefive11381rl +2dpkzggxxnineninethree6onexkllm +zdvbclq85xmddtggv9fgcsjm3seven +eightsix9fourfour +fourhrx7 +fourlheighteight6 +sevenplhqxqp89six +5mdlbrq9three85sixcsb2 +t9svczrjvmrtwothree +oneseventhree25fdq5jmbjmcthzp7 +pgzb31xfhkghbfljone6oneqkbg +vxqslqlfvp4five2zxvqdrbkt +two9six +threeonetwofvlklrmrkseven7mtldnsxmbs +eight6sjflkmczj +32three52sixfnqtxnnzztrt +qqtdlghsp8ks5two2qrmpjgccj +dknbccdfpr1eight4sixtvhfc +9mbc +pmpfprdkgblrnbf335skpkvxgstlzsevensix +sixeightkfs173mbmsixsix +twoqgptf1mfnpvxvlkrnxnine +54hpmzgm2three +1four8 +three11vkzqjzjncgj +nine19sevenzfour +4onen5fiveone56 +eighttwo2325twofourcb +lfpgbrvrfv47sckdqlqdblkjn +1qsgxhxtwo +83mgshbbrdpmseven7 +dsix66fourdzvqdnqlssjnine9 +3eightfive88eightwor +1djmjfive +dvxlvjthvlkrrc1 +zfgpndbflxmnhnnq9zx4 +one5twooneseven67 +13sixdgpmgseven +mheightwo1six4onethreegcxzvspnrqpngsmbplvhc +86sixlkdnnqqrkf6fjkvzlfxhhcxxroneprgrthhz +bsrsqjlskjbh1onezprh2one3four +6pnxslvxhsxeightoneeightsixnbdtkszthree +vjpp1931jdbrtdjrzk +7one278ninexgfive +mjkqddthpnineonetwo5eight +2gfmgdjkzbbf +5phlkvzbqmmxbfckcjjhfvone +8xjsevenrlrlctclvkc54one +1tqsnt11 +mmksbhrfour4ninefour3 +91fivefive +5sevenjdxdrrgxbz +threetdcdl531 +685eight3two +nshfeight6eightonenineeighttwo +threenineonermgnbjjzx8 +one4oneseven +ninebdpztnllhdvcbbpvcptpdkpvjhxrtmnmhllrnxvlgm64 +twoxhgcjdpx65fivedztfxzbdfive +999nine +seven6three8bsrqkfseventwo +6jf +sevenzkrcbxp6tmzfjnineg +b8xlrbjnrm +nine9fourtwothreeggg +seven8ninemkqxcbjdzzmrhjggbg5tksxtfcmg +2vdqplbceight +5drone +jxqczvknhmbxrdthree659qjxlrxk +5onefiveone +seven583sevenninepnbzmeight +14qb153 +3twohvplgxqqlzsgsevenone +78mpjrpmkponefive +6fmqpjbtv616 +325dj5lvtvbx +dzjvsszzonelbbvpnlkrctztjxgg9eightclxrqrzpmmgpzpmsxlfive +6lsseventbb8 +9tnqfksfivenine9 +5dbssjr +slbqhmrg3 +48oneeight9two84 +zxgcx9kfmxcjsseven +4nhb7hksxlpn1seven9 +seven4qvvzlbjnbhpp42one8 +twoeightgcpkkninejgfvzfsrjbtwo1 +846kmvbjpseven +33ndkljvxbxpjcrgjvct513 +6tcghtcbcgh9xgz3onenine +five72rfcmktxkvxvnstwo +seven5tkqbjgpkdqtwo773kcfznv +ninesphdrdxzvvvdfcpsvc6 +6q9pjsdzponerfnqt6eightwob +ztmjlr1srmgkeight +lsix2bcfz43mhpgldvlng +6srrmfdvtgqgeighthcvzpctzpdone +zntvlvtfmvntcvjxqffthreectlnzst5onekpxvmsvnb42 +threethhkkrqhkpvmfivefour16three1 +53fdhjxldlxxthreethree3six +nzhdhtcjbseight47sevensevenlmdtjsqlpqcmqmbvp +4bvsj +1ninesixtsbgdvhseventhree9jpmrvpdzxb3 +czqzzbbfcnzfive3bvcrvvhvz +53bqfhhrsevensix +2lmrjtkffk5 +5fjbdvxjrcrtvmjdttjfs8 +x1jtzzclsdnfive7four +5jnvphzlpphfivesix +jfkhkxvlqrdkbc67rqfcfh4rvprmvcone +k9sndkdgvzjg9threenine2 +ltwone1 +five5jhnine +5sevenlcnxcpgdnzrftsn3threenine26 +h6fourgqfczsjtkfqpcmzfive +5eighteight2 +fclsdrjrthreebvjspsoneonefivenpfszjfqcd1 +twofourfive1qbrndpvone23one +six4ljzxxboneqrhgvg26 +klhsqnkrqhlsfivesixthreesixfive9 +9rslrdg +15xfdsix +zbzd15cgcrn31 +fbqvdzgsvlsix4twoeightpjzdhpxxjkq +79xlmrz3tcgvfvqf +5csjgmkpkthreefgjqvtdskbvxk12 +vrdlmzcpfour6trmt8gtjfpftdkgdlq6 +rctptptb5fourttds +gfkvkcbkfsbvmbcthxzbfs9rzdnine +4zmkhjrcbxvdp +8ftngfour +fivefourninefour5four +3vfjtjngsevensixfqngpjrpfkcsdgctseveneight +vpqeight11plkjc +threethreezldtgz3hscrb +4sixone7qlgv +twofmqgtnkddkrfdtnhrone7ntq8 +tvvzmvxhjseven7four5nine23 +two3fourdxscvcljhrjmjlpbxgcninefoursix +six4twothreesix1six +4rj4twohzjs +four8ninesevensx49m +onernjnjrqsjhnp9two +3hsjlskjpcvs1nine +587 +one7threethree2 +dtsfhss6sevenseven8 +honeight5one +1eightworg +6eightvpxctxffive +2x6pkjntnbrlhjfkgbvp3 +9rrhssqzdlcmmjvqvrkvqpfonetwofhfhzktfzzdbjbj +5mxhnqdg4htcqxtkccghgrzktsnzczfqrpl63 +sevenseven7fivepgc +8onecctzfxreighteightwoq +mpfjlf1twofbzzhl3ljpfc41 +ltwone3 +dfourfive2 +jlnxxb2one +1cnxtwo1 +rmfjddmhh16eightone +bgrzn28eight22 +vp55nnjtfzjh8rjmzxxxdjs6r +5ghbzsbxqt94threefive +6tjvvtrhbglntone1bflzxmzvtr9ngd +zqlfffptkp2eight +six8threersgxztgnvrpjzjhgtprqbgeighttgkmgxvlpxgkt +zxbnqeightvhsnm95svscpcjhth5ninefive +jmgpmfxtwohvxsfr3seventwo +ncpgtpqfivejnblppxtn8khcjzpk +sevenonethree95 +hkcvxrjjshkdxsixbpjl62fzrzpnvtqg +cxzvnn52ninesixtwoonergjdktpkl +93nine +11fivetwo +8qmhfoursix156 +twofivethree27 +sevenlnjqseveneight6fivepvmz6rdbxm +vlrvxfourshqpprchjx3dcknntththreeseven8 +2three7threemscjggthreemkxmgg1 +43hghlbtcbf +jhpcdczrxgpktvlseven4shllbs2three +hpthreerhkgdtksk66fivesevendxxzfm +four3dqqglksxk +eightrhmvhzxlrdjvjvpzhzzcnvxxdrjzl9sevenfourlcqksq +9sixxcfq7onebmp +8keightfiverntpleight +jtwone831 +qqsksdcfsmvx5lhfgrl6two954 +8lhjzsjgms +8ninenjsxtzqkmn +gpffcfqxlr84one4lzpfkzdkpc +svncmqmvstwoqgknfivepmjll4xt +five3kkqzrbtvvfcts4three1four +4sixseven8five3five +six9twosixqtldl +2fourfq +mjrtwo7ninedqsmxskpxfc9t +onenvjnsrvjzrqspsdbgjhdjrzrfmxcxnc9fourtvgpdqzxvb +478xp5mqgnninef +mtjtzgflgztgsqpxskp37zm +hgsxdpttj64mthreegzptcsfour +eight8vfgtgftwofqtjvskxnnthonemgdhjzh +threeseven6llbgbrbptthree3 +one8two9fivefour3six +52dqcrxhzqmzsixmhshnntwo +lsfive5nvvhgsnl +8twoxhgthreebdfgcn8jflhc +297seventwo4ctnbprxgztwonine +3onefourkthx6vn +nltzeight6fggtwo +84431lzgcftv +spf2qkvqcq +3gfbntwo1fournine2qlp +nckqg1four7mhltx4jvdzpjzvj +bllkbr2 +fjjgvvmfsfivetwo5sevendd +7bpmh2zrgsms +fourrdkrgfoursix1 +seventwo52zbdmftninensfdvkhssix7 +sixxkrf4qgtnine2kqhmb +eight7z +rnfhttjjrpdnxxqfkhs9lbsktsmvsixone +61threenfhkskphjjjstnzjtxcjf7five +zhtkvbqchlvthree5twonine3 +pl9dhnzntgkmjhglxtlcnsfc +7eight2sixnine43 +69xfqxbtvseven1four2qr +1k7 +twovdgh768 +6hmjcxsgkvd +7jftfkckhzlqjqtbvmhxrsix +fivencbmjhjbp7 +trgtjmjggtzzjnhd5fsnqnkppkninesevenphgfrfive5 +qcglfonesix23bffsmd +five7srldjmmnhllftzbcdrm +two33gjtxvtwo3ltrfqdmvvpseven +gccvxspxlm6one +zdfjvdeighttkslnjnft7dl74 +ninethreenbvmfpbgzgkv3 +ninenine7njgrzxmnn7 +rtwonenineqxvbgtj4 +sbcgvsrmvtwo2sevenj68 +6dfrjfqxjghbxt +rt5four2 +vscftsphsqsix3 +3eight68d5kf93 +vpbjpqjrmz9fiveninedpzsvdvdfb52grzxlbbqsr +gvtwone9vbmpdznhlfive8two +4bnfxslqgvnzcbsjcrfzv +xtcdvhlkgrjjjmone48 +mzoneight9995five2bdg +ptwo2fivedqxthreesdmbvdcdxrtwonegt +vgjvrfcvbxnnfds17 +27threeeightnine3nineseven +4fiveninethreeqn +68vhkqqcs +sjnzkhxvnine28 +3fiveghc1threems +45jvrhdh2three9l +pbntkjbps1 +slgsx9sevenone7xcghccxqs +twomlm4ksvonefournine3vdxp +four9pvmone7twofourcndpfour +hfdnzvfgqn2 +3fsshkvcseven545 +six45jgxzgjnlqk +slrv18five +78twoninepdghsneightone +two83npblhtp62three9 +hjmpkjvkzhxpzflz96 +fmcnine4vmmtxlmdrntwofoursix +352five7935 +891sixfive8 +4fourmdfpkcpb439sevenfive +3seven69czrrsrzhpm +two5six56sevenlpmrxdthree +npzg6hpmrczqxmn3twommkmzkzhgkcxrtwo +f498hhvtrnhgd16bdcd +5sixhxdjmkkmdbskls +fqfvbsfprqrhlgrmdprx1fvfzvcgssttknck +9one741 +seven54jsjkhseventwo69 +8threeonejjonefivefivekrlvtjt +xcdbx5mqkstvqkbhrdfllzfive +gbf89dsrg6ctwosixppxxbgs +83ktsdjqt +eightfourbcl6797vcbhbl1 +threefive6seven +9ptxjzxj7six4 +onefiveqjjhfqrfzonesix6pfqhxvsq +eight385 +mvsqltkmsrzqzdgkf66onellkvmtv3two2 +khztwofour7tfnvhmsqnnqkbfdjgj8 +msvhqzqfivetwoschjghsm6 +lmsxxt43four +hdfdltsrtwoseventbqr7pckgcqtcgh8onetwonez +1sixeight +1t3qtqgnvdrteightthree6 +6zb997 +four83dg +4four2xqnpqvgkmh +cbrkm6seven27 +9rxrddhlfiveeightninesixpdfznbhrfrvjnjd +one8seven +7onegpllvh59bmponefpjeight +one4fftcrjntqpnzqlfive +9hgfbffour67two +nine6tworqjv +4xggvdktqfour6fljjxflkflqzeightcbsf3 +eightmqphonehgthrpfvmfthreethree8 +1five4xrgqxn +vkmqljhpcbonejjsx6one5one +two1five2dgftmk13six +eightmrv1eight +gkzznsmt429 +fivetwo73mhpmbndgvpklzhqk7 +84sixlhfxnspqjveight3onedrksx +6six2lnxmr +7rqsmbkcv +4jkbdtpsppseven32sevenqqbvm4 +two8vhhdsnqv +qksb8klxlv74891 +ninesevenfivenine26c +sevensixnine81zjg +three7bbb66 +three7vmnine8xqkmtfmpnine8 +2zhtwo4eight4nzjcvmjtdcv +eight57 +six3xs7zpdvltmmtnhtk +fourvfxnjddkjs7two +1mzmfsfnbqfgqvft7two +vqbdzhncsj7one13twosixxlngtfive +threel94seven +threenine299 +jqkmcsqtclq5636six84 +8gvd68eight1 +t43 +3bv4one32 +3onepvjdjpfiveqbgzrmktm7tkhbp7 +459onetvsone +nineggxcstltptbsixthree6glqhxdgnjp6jmjcrm +hhnvqptdkj9one +nine8four8897rgfs +onenine16dgkjnfkmxqfninervgcqmxsbtwo +two7eightzrpone +xkbcjqnt4fourdpsgbqf1three4 +27jcbntptlmldhnzmkgqmm +vfcrlftnb5mzbbsixeighteight +tnqkf4gseven56czt +teightwo4 +8eight1seven36slslntk +tnqkj9 +five84psznfjvl5onefivefour +nsjlsrkfour33 +sftkhmxq89hsvcsznrdxfcgprmjcktbxkbnkvb1 +six33 +rmbnnbnrdg7sevenhsrrnjvn2 +qhthj75bglpd2hlpxst64 +lmcdttjzrnxdnn6pbszxcxzxmhxj +62xvvkpbhhbthreetwooneeightwozr +mtln1fvmflgtrq94threeeight +7five6 +8j +1threehvkrhfm3mgsk2six +zlrvhfhpglnkpnm4lzljvzlgrzthree5three +scqbffjvdjhsrfsix7twonine +eight97 +6five1eight +31kvxzjpgd3 +sevencsgvmxbtgtp7eight +sevenpjnbgtmsninexfbh4mjdmgsdtdb92 +five11nqgttpfj +tnxxs729k +1sevensixsptxkmncrkfxone +nine1fivefive16twoqm +575xtbkrbnlrrtr7hfourmmbrgtjvj +three8gseven6three9hkkvjzvzlz +eightstktmqdn8mf48four +298xqtwotwo4fourhhhcblpg +7xpqpjdlrmtwo399tccfour2 +64xs5njxdnqvonekrsbfhlvttdjp +threehgzhfbqjzktwo8 +1jjgvxnprfbmcthlskqjqqzrr1 +nvpbcbsgbf6eight +vvkvdd3four +7onesevenlrmngnineseven6one +22three +msfbjpnd1seven6 +2fivethree2cp1six +7two733 +8sevennine4hsgg +fourfive293three +onedtrbdcdseven6twosvlhbdfive9 +8five8threeeight +gbj5hcjtfgbxppzdcf +sevenbbbj7 +msevendfkqzz34 +skrzfqonemzrcxdpdb2 +twoeighthfsgbsmbmsqrsknrdxrcxshfndvmhfzj1lhhtkktlxeight +178fbvcglzshfzknffgprnxvxgqnhznine7 +two13pxfvzxnqrq2tkdfsfkbbgkdt9 +sevenjbs2fourmjglztjfive +58five6vhm311 +gngfzhcdhmczsffrkh5nclkcfcnfivefive28 +883nr7onesttq +eight8four147vmtpgzbpft +6dbsixtwoonenine +three3tlx +jlhlvvztsmctvxndlnvbxk1 +qlfmbmfkfm98m +fiveseven5786cmthree +7tgklbjhhcxndvk63sixnine +fgjqhqvtwozjfxgxpkz1six +3dxnvg4ninetwo +5twoone9lnvdxhctn +dnjpqnplxq9rxfour6one4slqlhsnc +tgkfourthreetwofive4npnnvthjgf8 +tjzjppnsksix4 +lmfkvgfzfmhxqrcvsgt28ssmhm5fivethree +fourninefjxpvpbnhm29oneninesix +hmxjs2sevenfive68nine +five3eightsfvftdxl +35sjcqtqpqz7fiveeight +lbchtbsnhmxlq1rcjrlvgmdjmjhtk +2gmzrn34eightkdpsgnine +sevenljzcxlgpskvkprjb6 +sixkbsdxjvsncj2four +1sixbl9seventwotgtfcstqgv4lc +89threeseven5tnshndjcsxc +42 +ninesevensrzxkzpmgz8kcjxsbdftwoner +4gbdzqtddmt4eightsixfive +dljxl7five6nrzfh5one \ No newline at end of file diff --git a/day1-trebuchet/src/main.rs b/day1-trebuchet/src/main.rs new file mode 100644 index 0000000..0633f66 --- /dev/null +++ b/day1-trebuchet/src/main.rs @@ -0,0 +1,44 @@ +fn main () { + let data: String = std::fs::read_to_string("input").unwrap(); + let lines = data.lines(); + + let new_lines = lines + .map(|raw_line| replace_numbers(raw_line)) + .fold(String::new(), |a, b| format!("{a}{b}\n")); + std::fs::write("new_lines", new_lines); + + // let sum: u32 = lines.map(|line| { get_calibration_values(line) }).sum(); + // println!("the sum of all calibration values is {sum}!"); +} + +fn replace_numbers(raw_line: &str) -> String { + let numbers: [&str; 10] = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]; + let mut line: String = raw_line.to_string(); + loop { + let mut clean = false; + for i in 0..numbers.len() { + let old_line = line.clone(); + line = line.replace(numbers[i], i.to_string().as_str()); + if line.eq(&old_line) { + clean = true; + } + } + if clean { + break; + } + } + line +} + +fn get_calibration_values(mut line: &str) -> u32 { + line = replace_numbers(line).clone().as_str(); + + let first: u32 = line.chars().find_map(|ch| { ch.to_digit(10) }).unwrap(); + let last: u32 = line.chars().rev().find_map(|ch| { ch.to_digit(10) }).unwrap(); + + let result = first * 10 + last; + println!("{line} ({result})"); + + // first * 10 + last + result +} \ No newline at end of file