commit 28cacbd5d6a606a67e7f7c6889b11161b6f8bf94 Author: Guido Schweizer Date: Fri Dec 1 10:00:04 2023 +0100 day1 complete diff --git a/day_1/data b/day_1/data new file mode 100644 index 0000000..25e1cf1 --- /dev/null +++ b/day_1/data @@ -0,0 +1,1000 @@ +sixrrmlkptmc18zhvninek +jcb82eightwond +twofourthree778nineeight +sqpxs1cgcrmctlgqvzxbcjzgr +nqkjxbmbpkz9eight8 +one6fourfiveqndtrvgkkgthppnine +zbrbdpbfcfxcqq5oneninejfgqpkfn +hvlstzgvmjfivefourqjqtxdjmbxfour4four2 +13dzbmbtl6 +fourone2pmlxzzbmnfxg2 +3fourrbvvlrsrbb2858 +vlz4six89 +75threeb +fourp783fiveseventhree +2gxvcbsmn6 +896 +dnblxtxxpstlsix56 +4fivecl185 +onefk8sdljtfv37zsxsxrv7qvrpnmd +fourdvhzp7foursix +seventwonineseven27jbrqpxfx8 +1threenine241gnrdfqn5 +sixnrsqdgmkvs7sevenkgjgtglmdq9dkdzsdqmq2nptbxnxghm +llbkdcpxkg1tnmnmrbskpdb +zb7nvjz1eighttwo6nine +5threeeightwor +tgjmdbr4sixone5 +4twoseven7tjmklbl +lt2vqgbkzjpcjzeight3frfzqgbhvlx4 +4sixseven3xbmsfxrrvv2st5 +gqlp7 +h137four +3three7three7 +nine9sjlzcpjvhcnbhbthz4oneb8kfb +jlrjz5two +sixthreeeightsgnjnmffq3 +sixone87onepclf3 +two4six +5dsnxrcfxb4 +fiveninesix4 +eight9jhqttcplxhtjthreevncsfnkpn +4mgqksbchbcrxp5fivefourlzlzp +xhzone6 +7nmcxjlmq94twofivethfccvn +six769fourtwoseven +two41stkvkhdgthree5 +jvpftbhljmcttkr5one +9ldhzhplpzttwosevenblfxfdfour +fivekcfmfmndbhtwofour32 +49qsslhxjqv1tsfqhkg +five2zzstkq3935sevenpbb +8sevencxvfbkv2p8 +lsmmnpnfourhjbfk67 +fourtwo4onethree +1jf1eightdhvnclf2four7bmdvh +tx4xczz1 +5qjlqp +sevendmzqnjdnoneh1 +72seven7pvjxdlsix1 +four1eightvbbjh +8451 +fivethreesdtmtr5four +gqhtwone11ninethree4ptjsqlg4fivenine +one7xctgtrtwoeightwovkv +36eightsixeight4xnmhvzrnbb6four +pjrtblbj759xpbr6 +hcbzmzqssh72eightthreesixgdmfivelmctqrz +rhkctwo5twonine2 +cdptxn6sevenjktrlzlnlqxdtwoeight +six36fnqmdcjgjgbqgqcgffivetskhjhkpdqfive +qmpm111nine8 +73pcctxthreetwo4nine3fivetwonehfs +nineeightnnfsixpt3kbbqfkhhn +bvpmkrjmzkvdnbhdnine47 +26dmbqnt4oneseven5qvxfhl +2sldrlqzone1pfdlsqdgpmnktdh3vtplbsvbx4 +238xrtqfcfgsrmrhkxz6 +5eighteight5sevenseven +qtlnninesixxjnmxkntpf9six3pbrpljxhb2 +xrmkj137tkxktdnine5bnnhp +gkqzprfcrfcgpxnvggsnccsrrk64oneseven +zzmgmkvgrnknsq6tjgktmbghkl6 +xeightwoone91 +9j +eightlm63 +fmctjfspmkblkvjtrcjdfhrtwo4fourdnkrzh +3rb73 +8mkzqthreeqtvhc7 +qgmbchqqzsvx45eight +oneknnlhjffrxhdzbgj1seven +pv1fourtwo +fxvgcx9vrlqssrrqvl94 +sn6 +57twoonefourthree +gtwoeight6njfdpvcslcponenineqrxjsf +8six1two6jkvltvgjfjsdn +fourrxtjhcdxhr1fdqdj +one2onefour +three3four6pphqkx8vrgvbtmqckpz +nine5nskhdvvbnineone +7131eightone +one1sgckzz +sgpkknine6threehkqchz +4twoqvbpxzpjj1njqtphjbr +4pfcfnfqftbfnxds +bmhthreecsslmgpzzddpxfthreefllkhdtrlj2 +9threeeightninefqdfptj +ninenfbsevennkngdg21 +1fourthreeonethree3 +tjpjbmrsevenhcllbgdqxlctdk5 +2srjxhvbtqponefourtpsgthckseight6bjvnc +68b +vrcqnglljm19nftnzzjdzhvhzrgznine +fivensjpfvltr2cvfhkcfsvt4pnmttrgrr8five +tgzdbrgdfoursevenseven8fnxghs +fourmhmql9rqkpvpgj7 +7mgk +2z259nzfqfdhthreeftwo +eight57lzhvpjcxpfivevkszhzbfourfour +sixone984two +threezdvkl15hk9eight +4dxxpjttvsdtwofivenine +99xbp8fivemcvonefivezlndv +seven7six8fhxhxqgr3fsqqqmzdtj +one579vdplvfghvf +qzzthree1kghtwomnlnxpkmeight +44eightonevnzxchddbnzrfpvxsix +fivefive5zfsvhfpkzzfiveeight3mzrkkk4 +46xxzbffbmgeight9dcmtwo +tvmgkxbrtdv6mzcpkf +kvbczdkgzrxsxm3one557onevzdhzgn +xrfxxzlmtlmvgpvninethree1 +4rnzxgfplmnmjppqv6txztmmcpnf +five47fouroneqqrj +nine5cxxfcqmeightjqztkdqxnpqthree +2zlvnvptqkzsbvp9six4bfhp +bhvkfxhdnrmkfjvsmkt6eighteighteightzzvpddg +12seven49six +5rstmpbrt5fiveone3one6 +24four +fiveeight9foursix995 +8ktwonxzvt +gf6six39zxvzcfbtbxkvqrps +gqvpkvvgcxctwo7 +52mhhzfivebpn9 +5onethree +one2cxzklfh9 +flrtmhfm985xmkpcdhr +4ltqdsixfour7483 +one9nine26gjtzn9 +773xhnnch78 +one7sixsixgghp +5292zljdfhjseven +seven3onesixthreekz +seven5seven3seven4zgtnnkkgseveneightwosg +eight9vnfsvksv +5seventwo9 +onesix7 +4one3two35nine +5mmrdtrzctqxggtzhplfnphgp +v94rpkdzeight6foursix +four1mslzzghlpjtblzfour +scrv2four4dxfqpcvnml +8sxjs1141fivefive6 +3eightpqsxgklhkbkdsppone9 +fcvpsvmsevenfivesqsqvhm6hqmshds +5sixfive677 +kgmpqfgjtk9hghczzhpsgfhsnghdxngd4 +2xzph98twonesj +kphxn9 +sixeight625ssnpmlpsbtwo +twofourhbdmm97 +ndseven1 +onelf51 +88khzmskgldcgttzqnzxdh4bnvxzgdr +lchrtnsxtwo7749lbdgfour +mmrktfqvvkzrglcpkfjrlm34 +5six7psdcckhs413threebqnr +seven5oneqfourkf +hsngkzgnfninegmjvtmtchdgs5grf +8qxlscsevensix8 +bvbhc7dfplnk +5jjcshzxhgzs1mpqm9 +vzqcvvtqjone7one +one5threeseven +hbtvthree1 +8five2lonecflvtjqh9eight +xckhrnseven9six +vggclcqcnfsix8seven924j +jfjlzm1fivegplflrcvsix8 +zd6psbxlv +mtcsbn2 +eightd29rlcd4 +six41one6csgdbndn +four1mh2fourdfktmszp +14nsnlqqlgfourxbzzxfztvbxsnxttjmktcxkkkzfphppsczqoneightgc +9vlkdznbjt5zqthreetwonedv +hqqtrzmknine1 +6eightsixdmkgnvkjqsqsdhlfzpxqpqdzrlvxm +8four2xcztwo +mptznhrtsq5fourfour4one +8zxnrngjgtgq +7s +68zrdjfxfiveonerbrqbzxpnhsxkbsqsx5 +2eight4nine +fiveeight6two +12jvtjssix87 +qcxtdnzhtj665bqffftxdp +gsxeightwo37v1 +fxbvtshpbldxfdnkk69jhvgktlthree6 +2hbxztgsmqsgg57 +five7sixfpjqdcbvxfgzcfgb +soneightthree29qlsddxxfl5 +cn2 +29six +skrbzfmsixp26twofournine +two8onepcddklbzfoureight8 +nldvphs7dbqxsfflxx4 +8pngqfour +ninefive69nineeighttwo6 +nine54lnzkckcvteight1bhznxgsixeightwor +five18sevenvgktwo47 +1eightkcmhsb +djcmqbvmfsztncvvthree5 +sixfbbhffjnrz1mtcfbqs76llrvjghtfive +five5bkxn4 +8eightwoc +khvcvqthree7rthjfivezdglhfnstbtjglxlpkztwosix +72lxsfkmzrb1 +nmhqmmxlqnpfour8 +zbgtwonezksvdvfqzthreesix6dlc5 +6zvn6 +5pmrjmgvsdcsjlg86 +twoeightseven21cvntvr +3qmqjjqtjskqtthree8sevenxm2 +four5fourmbdx +jpdmdb35vkjdflmlt +224 +six3msltlcgtrnttcvtkrnine +nine1d +eight6eight6 +sevenm7 +threelkngfmstfour9ninelj +5rjbbxmchhfhl +1two6679twozcgbbldmznvhd +eight2tgxkhtfmrk9sevenxntpkhkvjb +ninethreetfgtsh6ztcxczsxr +9sjzjdeightmbvrvx4 +6fivetwodszsmffjbh +sevenfivezcbqhhsntfbpkz3one3 +7onenine11 +glghbpvrbfqsfvnvpxlb5vvqkt8eight +rvhqbhlmonenine96 +npgvjlkdxmsevensixxrkhlt5 +mhqf52scsgsxtwovcpq +zrvznqpcjhtsghfb7 +five8threeonedl +8threefiveknqhmm4five2 +xdbd4cchcfpvzthreenqqbdkfbnfspmklhvp1ztzs +fourmn932eight6rjq6 +tdj3three +2nine98lcpnbchtcfqvqmbrzlhzjjrcsmzgmd +1tfive +6cbhhqrvjkzfive4pbnrr5hbvdbxln8 +2eight8three +lvveightwo9ninegrlptxdskq +3xpcpqkrznrgq72six +9pnczone4two4tzjktcktzeight +6eightldtmkj +pjc9nvbhjmhnine +bznzg4sbdmhglddnvbrxtr5nineeight6seven +51four7eightwopkv +323 +3cxmrtnjdonehdsxlfneight +7kfsxscrsrffour +six2sixthree6 +2nljlkkdoneseven4dvkplq9eight +31six9jqrgzmjlk +ninefour659 +zjcfjzbfivesix2bqtnbdzlssvr +4onehzrmb +6dvfnpbdnr1fhtmdddqx +phvgzphlvqeight1 +22s5 +fivetwo9 +gxczffbjgxonerhxklzvkmp89 +fbrxkzpsmb59997 +tmf6 +ninefournine8 +42fourtwoeightsix96 +vmhqthreeshcdtwo2three28 +lpzbfpfhxj8rbspbrjgd882 +9threesv +6xvqch +6sixdthree5sevensbxnxvsixthree +five2jzsconeightm +three9three69eight +7789qfhlmznpqzrg3 +bbf5dtpqhs2jstcbkcfmc2nine +eightmpppb6fpdonecrdrbjqtc +nineeight1nine +four2tpqrhnj8fivexmvhtsfive +gbzzxdd8 +onehrjlhprzz5 +fourzxxpl2onetwo +5four5two97 +threeeight2 +5one68656scpqt +7qljfddcld1czjb6fivehtqcpnbjfnmrrthree +9lrzbkvqmjfv5qkrlmjkrx436 +hfivetwoxgjkfc72two7 +gbbbnscg6 +glrhbfrfivehfkfplnrt49seven +nine3sixninefive3zksdxtbbf +ninesevenvgnlhpdb123twogfvscpk3 +fivefsrtpxzlltnfnine1ninevzsxbnine +7nineone44bdxoneeightnfpckpdjsq +rcrtqnnrm15 +eightfive8 +eight2dqzcjfkfsfoureightfmjrpdkqj9 +one69twornine +fivefjpzeight6 +5qxqdcl7qzfqvmsfnnine9fouronedmdg +7sevenone4four5eightone +phxdrlcd3two +fnoneight12vqscqzxdgdzsvfqggbt9zphpvndl +eight6jhjqrvsgbteight2 +gdhznsvfmdeight6jpvdmrdsix92one +onescsrmks474ninetwo +51bmcpkkttczbsbhvfdzgfbccbllxskmtxvs +61eight +qfplfour7fourvhsbxtzrb7three +ninefg8two +8seventxeight3gzbvjmbcmzoneightrlx +16twobghcqnfiveseven +one26sevenone +three4sevenone996fplzjqh1 +pkszjvhtdg9six +eightfcbbchqtxbvzmdnj1fourkvldvbzltm8 +5sevenfivevhcrl78 +7bjmr96ghmzhzh641 +seven71 +ljstghtkzcthree64two3hbvbgconethree +9fourninednbrkdfnxeight2zppqsnx +zfjm8ktwofivezr +qtfvmhvpthree4fivehsxkxnpchmfcvr2sixfour +ninetwo3dthqone +six2ncdntspl1fivenmxzxh81 +twoqtpfbfive8mhvkjstfp7gddzmmdnxqrvp +threesixone3tgbtbone81one +8vqmtnfkhm1 +zgtldxtbgxgfour8eight65 +hbk6threeseven +1tpnrcfivejbqllpgx +twotwo4xcppqxftxeight8six2 +2seven5bnvqdfbtwo8eightsflgdzqczpcf +two45 +4kqrscxrsdveightflhrmcpxrnqfrzrsixkj5oneightbls +5jttone1six +nine95eight3fourseven +fivepkknbrqfkdhk8ndt7three +sevenfivetwo4vqkjlznxl9oneseven +nlzrrsbqllsevenfive94threecmzbp +qnszclmv6eightthreeeighteight1nine +oneninesevenmmqpd6oneninenjvcrbgnjm +jptwone67kqxkdfscsjmfseven14kz7 +threexzxlgceightfour8 +3fzbtwofivefour6 +hdr4plslvxqxm6sixnine +one62ttrpmhjvfk1 +foursix5phpfcxzrrbhsv +eight81 +7cfdqxdqjq +69eightfive +6nphsmsqsevensevenonefourbsmg +sixeightsix9vk +freightfkthreesixfour6hzdmrcqzbs +vclmkqdqeightseven5eighteight5bbvzqlslt +nfbzpffd198six +jpeightwofivethreetfzgnpfive1 +sixseven2trjjh +4ssfourtwopqsgvbvktk +five8twoonefksixseven9 +5eighteight2g1six7 +fivethree9twonelgh +4fourxbnhjfoursix +lqdspqgjnnhxnine99oneninefourttpskhdzhq +fskvvccb178 +eight3twogsjlqhfhr +sevenklhxjjlzrx7sevensix +84nine5zqjbhjsxvn61sixone +two9htsj +sixfiveninep75tgggjszfbsix +sixbrthjrnnvmqgb8 +tpcb25twothree +9fxkfzmqdgll +cnqjxttzpthree2vfxrklhrmgsevenvsjkf +tljlxbfbk43 +mcpjvsevenseven5three4 +cvvckfncxjlxrp381four1 +63vksn7six185nine +fourhbg8thjnmvlctsixninejpjkxqhcljrvgrm7 +649eightone1four +nrmjcbpdsb6fourpcbpb +one6nineone65 +g2x36 +nine9sixvbnzsqbrj +four3sixhfngsjrsnth977 +seven9692dfchqbdzztmfztl +six1pdtgbdhzmqtmhz6ninetwo +rzjssbsz92six1four +4sevennineninesixvgjsxqrgnbgfpzpggmkzjrq +5onefourthree7seven +9zgjt +eightnsrq37qhthree +czknlpbntwoseven1twopfhfdhrkgh8sevennine +3eight9 +sevengltpjfpkb32ninetwo5 +five8ninehxgkcfxm5fthree4 +8three9drtnqx +lldtcdsfvvqcsvprgggnfourhklqqsjbvttskq3 +vrxmtwoftjngsfour1sixlfbdkxbppj7 +khvvrrhc2eightfive9 +kmsdthsbffjxdgfvmppgrfglxkplv2pvtpm48 +49gzlbspqv45qdsvp9five +threehzjcp6threed4 +sevenone6onefivefourcpznxpseven +85zc6 +eight92fccninefourthree +36hpqnpmmxrhsftwotpt +11six6 +5vzkjxh +4ptvlmns +19f41seven7twonesmr +39threevrvjhfpzmp1seven38 +five6eightfourqjgfvhqjclt +ktjsgzqkzgplz85 +242sevensevenninelrxhqvddb6mbfxmx +54threekfcqtpfgeightvlm +sixfivetwo82seven8threes +vtckldxdssix5mfjrmhvtlninemq47 +977sspjhmddkznine1sevengjnm +ninexmjfhhnhhv3ckndjbdxjcfive4 +toneightnine96 +twoxfsix5qtjghvqnjseven9six +fflplfmqx73fivethreeqmsncsl2six3 +xxvbfcbb7kkjzgmtvp38df2gcfhjtt +knthlxc795foursevensevenseven +twof91two4 +four9sixjkjqcrnine9eight +sixnine1two5 +mrrhthtfbszfxqpkhs57 +five985tmcr +l4eight +twosix7 +ggztprpshxbgbvgllfjxr7x2ql +9one6nine3xttqxqjnjsvknzg +1nine8172 +1npfxpgcmbckgtcgvlksevenjfdbs8sevengqdcsn +eightzbjqsix613nine +sixkfczsxbnpfourzsninegtjkg5five +47four4gtwofive +jczqhs41 +2jzmpchxv +xxxx8eight36sixpzpdvvvvntwo +two649nine6 +four36sixhfzslcnhpssixthree1 +9eightninefivez +933cvvf1sixsvkr21 +zrsnsqdcfmxm9fsjqfzd7 +five7sngmpcz +sevenlzrzgddch5dnvvkzf3sixsix6dnhtbkq +5lbdtxdzoneone6 +vkjvhl4mslfs +pvgvmtxvsjdpth39 +gg83ltnfcsv4seven +lksmpxxd91dnkjq1fktbfmvgh +djfslttn2 +onefour9three8sgbtlbtsmh +qnrrtjxtninefive88sixmhhbqs78 +mgrpmfvvxf37onefour478 +two26two +4three3five767 +eight5l +3pm8cpkczckxfc +6nine5one2841phpgfxhfr +4threetwofxblrfnfhj8eightone +ninetwotwoqk9fourqmzzz +211127mkhpmsr +mssppjqvlt75xjccfcjfiver +57mfour +rdj6smlgs +gjllvdmmgktwodhnnbsfourbvqvlvpcv6v +seven2fiverthjdnfqgnine +7sixtgns8xfmrx +sixdcfpbdt3lcnlsxxone1 +9jxpl5sjzqxxk9 +four2bzcdrbmfiveseven1four +jtwonefivefvftvbpsptftbvpxzz2fhgmlqrfsevenvrznjjlchbqtrgbb +4seven3crjjzzbseven78gkcjf +djnqxxtsevenpthdvddhdm5977three +threeonethreex92bnmpv3 +klgxtpg4one3kcnhfqp +2dhsbc98 +mrqfvbgjqnfpggnn2spmjkvbchpzpcgcmzvcddtl7seven +3xccrgznljpskhxnqbtjtcvmrmthreef +4jphblzdzpfouroneone +68twotmmsdvxtwotworrjvzfiveseven +864861 +1qzcctgzsixjtlztmdrtd2 +4seventwo62 +one8kjkjvtvhfive6tsvqnine5tkdsv +7m2 +twoeight77sevenfs +vb8gflhvvf7hleight54 +fourcxmkbmmzbhz494gncgbsj +bjzzsllj5gphkfnrncp3eightnine +four73 +psvtbtf93zgdpmjxrmvsjmceightpsmhvhtfrthree +492fkvcvcrrkhcxtgdbdclzn4 +bmf5 +twovqfxqsfgr8glst1three1 +qhqfglndqzbrhvxjdhgddnfl57vmzseven +tptfourfour4threembr2 +94four +57xfnxbcqntkrtzpzcvfbxtjjoneone +7nbsmqjqzthreegddkfournbdxlrrl +jdmnzjpxklfjbnbqtbc2onefour4ninefivenrhdkzpjcn +9621nine4 +3qbtrqn4 +3bs +5qncklxjnzr4seven +64sevenjdpmgpvqszcb +sixeight3five89 +4twothreeseven8nzd1four +7ntnp8xqhs +fourxfzdrjseven8four +3lmgfpfbkrb +jqfsptcs98gjgvgbeightsevensevenninesrqxjoneightdvb +fivesrzpr9fcntvgjeighttwonjmthree +2hdtrbvfjhpt3seven439 +th8sevenseven +xdnbklcrz7two6fivetwosnfszfffqtrbhtr +6sixninesdqlrc +fourxjtddtqgdssevenfive6 +2ninethreeone +4four8 +five62fivefivermd2six6 +eightsevenfour8thrmnsevenflmhqvmptnnine +eightdd4threeeightone7rtf +gkkonerz668srfkl +zlt6cv3ninetwo +3seven3bgklkfceightsevenbhvjjd4 +9seventhreellgvjs89 +fivemjlvqdtp2czcht +kldcmlddhzthreethree2ndzqcmlsthree9sevennine +tmxcpqchmqhzbjhkrpjtq217four +2twogssdgqxtwotwo157 +twotwo8eightsix +91gcvsfbxnr2 +btngjhhlpnqthreesixtwo1onejrnfxldzvx2eightwovxj +9eightsixsixtwonineninefive +ninethreeeightxlx3bcfdvqct +5krhtdqfpc5pq +four6xzqs91ninetzhpjdtdkxxthzhp +ponefourksmmg5qqnldbdbbrtlxtnnr +four3rc +sixfiveone58nine +ljdbmmlgg7 +six5fq +5three3sevenhxlsix4bkkbsfdsgnncf +twofivefcfb6 +mtgtkrrxhnine7zbqzdnonethreej +twoonesevenscpqxpmxeightjgbfour7 +5gfcknine +fiveeightseven9 +foureighthcstwonxrjflrbzpfourfive5 +9cxm +95rjzhthree7sevennineninefour +7six9zghtzslldb2ksfrcrntjfjcq +2seven9nine +86tncfxmg26 +sevenfivesix2eight +634ldmgqdntcbeightone +3vxvqbhjgjv1skrseven +22one +ntfsixone4zrjglkone8pvgqrnnppsxxbqh +foureight8rrrxbt +mmkpqzgbfn4ljdq8onekz +856six8three1 +onez766 +42eightfivejzbpgl2crltttkhfx +4eightlpksrlkjzpjxh7 +five6onefive6 +seven1eightxtf +txdczfnngfxsix4 +fivezvkcjczgz1gfpsdspsm45l +4gvdvlzxninedfndgfkdsixncfour +2two915sixrqjksjr +cbjhntsevensixfivefgpzzkgkt7pkmggrptwo +jplfnvvgls4cnvqtkjffcqlfkxqm9zvzvsptkfive +7sevenvqbvjrpnglcxsbqxttfdrv +57sevensix +2seven65smgpnfbm4pjbpq +sevenhsix31drcreight +9fivejtbqkmkf41xfninethreetwo +threeeight7sixnine +threeeightsevenseven8 +four3qrz19sixmvkrhjbb5 +mtfbjrknlrtwo36eightzkslznj +kndkhvzsghsdqpfonekdqjfszhv6hmrgbf5 +gbxjrvh27five675htszone +6rlqppzkcsg53two +sevenxnrnmrh3cpllvxsdvd9 +gvtrgstx6xbpgpjthreeeight +hlzvszhsix4 +dtxjcxfx7spkprqgn +7five6nineseven +6ntctkrjdvl1pgjhm +qreightwo395 +nineone4eightsixkt3four +19five44eightrtnseven +1v6jskjjkzjthree +fouroneeightfivenjpcn8ggtvz +rhtjdxdljht919five3 +sixsevenktqxltbhseven28 +26ffncztbln +2eightsevenstv84319 +jrqhbkj93tmrgfgtlffour97eight +84two9five +27seven86six9 +nxsgbzvlkm9six5six1 +five3fxmeightfourthree66 +1nineeight2one +tbfvqssbxl1meightsevenpbk +8sixthreexnpvk9lgjhpzeight +qvchcvkkgsbeightzhkgxjnine1 +4tkcd1threesix3 +fjmnhf9nine9kmmeight535 +five9nrvxkhnfour +2eightqdmjsninej +764nine1two +hzcxjs8foursb +1sevenfivejlcn +2dzrvmnd9 +nine8j9qgfivethbxfcvsixthree +1threes +fivebhcl8five +6nrrm +three7fourdr +czqkm8qmbpzbbfour5seventwoczrj9 +krrjcbqltjfourfive1one7vhzftwo +vsjxsffrrpz3jmrgbcbjh +19sevenvlfndx2onetwos +fourrshljvhgv18ninenbgfour +h2sixgdlxbcqjmz23 +btrhktjxdnvckdc5dz +fbzrcltwo12 +sevenfour8fjgvsqk29pgfpzsmj +two5fjpdjtqttt36 +eightljvvhplp5nine +53eightrptfckvfczseveneightsevenqmxjpvhgnfb +1jtngmjtpftgzzdmjfzhmtxf +pgphqgqvjzfeight67 +ntqfktninefivebfrthreenine8 +fthfnml152zqseven1zvsix +six9sixthree9zsrzpxnvqp7 +xfqjxgjtzf19nzkdfourtwo +jqntpbdlpsrhsfbvsevenjgxhkcq5one +1fivevstjfourf +prdvlvpzjxrtmdfoursevenfive3hxvblpmkvh +dzjdfive7four1eight95 +7ql1nine1threetwosjv +twonine3four +6dbjxsbqntbhrfsxkl6six4eighttwotbztgzxtsk +two9bqbnfdn5 +8frt3vcd8h +fhnrjsixthree3 +pfddphghh41 +sixfive1151 +6six9one8rrjvpptljmbssk5cprgg +49ljkjvjcbbthreesevenrqhvmtspftwo5 +nine8615qtxm8 +f96five +9sbvxpqjhpjeightjxvbxs +cvssllqx32 +4lbgdsrftqcpsbscvmkhonezrfourtmpnnms5kzrv +7four5761seven +dktmlnzhpqcnhgk5 +cgzgckzxcrthlb27tcfourfiverggslx +43eightlpcgtvx +szkqjfmsixthreegffszqhhninefive4gdgn1 +rhfzbnczlzjjfskg838 +pkfoneight1five3five +39sixnineeight6 +hzjpqnmtndfive6rpkgcpbvx3two1 +9nine3five373 +kxccthreeninefhcvzh36five +three5mqnll1mtgbfhr +seven5tg4eightcctnzthldreightsctgkshdgr4 +six4fivefoureight3 +qthree7 +4threethreetwotwothree1lvkskqgn +69lczgone8frk +68mhcnineeight5zncqz5 +eightbsjvcjnn7fourfive4seventhree +five9eight +one4four5four8three +fivesnkkldmjxfgnqrmcjtkeightgsb8 +sixscmqtfourgjzxmtcqmt2zgnkzspb73 +7fmdrpbeight151stdxxz4 +teighteight1557twojkccnlsgxp +sevenmhkptflv1 +ntrlqjtxjqcxltg138 +one9zpthree9 +two7mtdj69 +tclxbdeightonedtjsdbone17 +5173 +q8ninethree86 +2eight5one1seven +9onexcckgdxb +l1jtwo +ktfnfjm4 +7lxcrfpvxggfkpfnhjmm36mjslmhtfpmeightfiveseven +bvhzdf74onelhptjshq +eight3srvbqxmcnthree +fivesix2ptjbknone +vggmbmqspdj7six45eightfpglndqmsm +eightsixcfour2 +kctpnpdbsfour49zncpnxbrzvqgmm +7nine8seven446fourfour +dkmt1pdpz +eight6xthvzjcjoneone6five +pzpvrvbbrbdsdbh8vonemkntqnrpn +1xbvsmqbmbjfeightsjsr +threebfcsllrone74tfdmrjnine4vhfrv +5pt6onebrknnstfcn999nine +hz8vntdnmvtvnine +cgzxctckcvpvdg24hrdztmqctqmqkjbjjgl +pbkmkcdfqsxgtprrpgprfgk96sevenzxsbjklsbrsmbeight +sevenrqfourdxqnnlj89rnine8 +ninepqldpssh9h +5bjdnine8threefour +1onenineeightmnglcrd +xjsmppqm56seven6qqdsgpxkkd +six79fourfour1 +2jrdzvmfone2six8 +sevennssvhnpxkl3dsdqlhqxt3xkpqnine +foureightone1onesixnqlrkndqzf +742five25ninethree +onexc87gbrgsdzdxqvqfns +43zrsfzzsgm4fivezqxxztkp +qvdnfvjlhlmznine1twothree +8hdpjzkzblbcjfcl5ktdjfoursixfour8 +twofive7phqgtv +six7ftkmlzfx +4sixsevensix8 +1qmnxhfjsrq +3fiverfqqq58two +sbqhm6 +9xxtone6 +ln5vphjcpqhqqzdmpj +sixsixcvnkvvrq3vrlgfvzbf +8qkmsvcgninebfnsgmvk +ninemjsbpppdmknqhjkvcqkq1four8fourseven +sixsksgflz3fiveoneqmrk9 +945cskxxdtnt42 +ninesixxsfmcxkfour9gfmgthree +sixxgskmzdpsvlxb8five2 +6hhqdfbjthreeonefour +4onemzcgbh +onesix1five +3sevenhtqtbpp5seventrrlpfmg +65fbcsix +8rtghmdsfjqv554 +1cbnhbdrczvmfiveplsdjq5eight +threeninemqfbrtlbpc85three62 +four88fourjttl23 +onefivejndtjrgkqfmzrlqv69twoneqj +tworzgmq434qtlqtlfqdb2twofour +g74sltkbkzgmthreegscb6four +eightzgshcpeight5one +fqprbftzmjlmdr4jssixfrfgsrggzhgxktqr1 +kdzzccthree8szbzqtq +threefourcbnjx6vfbgrcmtnine39 +eight7jscjxtvxxbbc +61tstktfive +2threeseven +rxsfrxqlmt9 +zqptzffzmf9 +b4eightthreep7six +onethreebvnqhkdzfkbjrgnjdtvzgv7sevenrhp +sevensixnndcjznctg1 +m2 +15sixvmsqnsmjv7 +242 +25kvtgjnxtk43eightczvl8 +eight8sixthreelcfddgn1hzqxjfvtjzqpkzdltdpjb +eightfiveonerxz1 +mphmgxtqjlxjkx6rzprj1hrbtmnteight +jldrhxvgghbrv1 +15fourrfzncjlgnineeightxhnvv +566three1fbs97 +7pqmgdsix98fiveone +6qqccfgxhbhdhjzmnqqqmb +five1onepxvdqht2sevenrggfhmtwocmmfxplbmp +cnine2nineeight741 +kcggzltqv9trcznjzfkmbfrfqsvvzsfnlh +jttwone6dreightssfptmbc +3blslthreetmtwo83 +78965rjgchhgll +5ljmbjqk7hgjdmtgxpzs +twosmk3two4fiveeighttwo +qttftkrmrpscczdtxkcfournineztkkfour1 +71flmtrrssgcrxlktdmpbkh +vvbmqjh33soneightrg +3hlzmdpmzrrfqczv +seven8twoxtzjhq +64h73jvqjzlfcfdfour +sixznbkx66spzg +dtseven6 +seventqxtnkrvv1sixseven +cgtshp1 +4nine8 +1kptdlhbsixthreeghpgbjjr +pk7four +7hbdflbcxdfivetwo +eightzrzcrnlkd2hrdpl +twodpsix9fivegkdkgtqlsix5four +4gfgvsevenmgzkpdsix4 +3eightqlg29 +6fqvzgdbmgjl57eight1nineeight +two8xpqlfp3njzdfivecvx2 +gbtwoneftrjc733four +6gqrfzrqnthreeseven4sevenltfpfour2 +gtgnjsixdxt4five +mmvrthqbkvvl37 +3one4fourtpspnczvvbvlrthxc +2eightjqmjqkninecmcfkpvvxl +fourninethreethreebqvvzd6eightwor +7four1gbnjmmbp1sevensztfrvzx5 +6one5hcdqtfkfzbl54five +93bnghqnine +cxjvtgmgd7qxqxmxv +6538three6threehvqx +95sixseventwoone +one86nrfddkxnlgvglqbdxfnf6nine4 +8zltdpcmctqkhhnxgcxsbphxbksix3 +rrdp4psctpgdpm61eight6 +cxgvfqhvsevenrpg8threepfqxphrjkr +fivemnsjxdmhqkzhxv4 +5knvlqvr1fiveqfpjlqltwokjf +threeonegrxgzsvdhkdcmzvfpseven5zmfiveseven +eighteight717pxblll5sevensix +2cnhcmftwosix +zzbdfnine3x55 +one485ninecknv +7onesixonesrptdsixnine8eight +9fourtwo9kmjmbdnnvjjfgxdc +foureightonespxsprvxpmgqqcdtz5r9 +39hzsklqnzpfivepsfjhkpbpgvf +7five7threevqjbnthree9ccv +qlnoneightfnineninetfdmb8msixcxcmjxpvfr +sixeight2xflfivesix +jxxzbnine5tlhzrzq54 +6eight7311 +8twontzkqkdg6ninesixzbzone6 +eightsixfournine9 +jmrd4 +78threefivesixseven8gfc +rnmcgvmponeeighthxn1 +seven682mdxrvzfshseventvpgvv +eight5jftlfcbkfr +four4seven3 +4nsmkvsxc22tj +three4435 +563threesixtwo5six +qxlzsgvkbh4 +xoneightsixfourhlrttrld85onetwotfdx +7dvlkcphhrdrzttqn2ztxvdbhdhtplmcbhphxnvg +hfzd59nineonexznhg +onetwo29threex +3four9eight +jcqprfrm6nmzplggbrnine +kone8 +hgn9pkrxmrtmtwofsfdmbgnmsfourone +8pljqhtm +4eight6fivetwohbrxgtbb6nfive +hgdnxvkhghfnbvgsqxn39eighteight +tzcsdqkvkhvcrngeight226rvvz1xkblchlg +9qlpvsvdkxgbsixhnxfrcfmx6seven4one +9bcppqvxt7eight3five +5tnmcnrlsnqpkrfprtwonm2four +8eightndzgrtfgpm25tsdcjvckninebchlrd +9sxjbgrvtblnxfphqsix571df +eightckd32oneightk +twotkvsixoneqnzjd2mnhhp +two3l5sixfivecgkr2 +nine4two +964five +seventmxhtjnbmj7nlkmbgmbxbhseven +99bgdpvhninesix4threeeighteight +1xhzbjtmfcpd8lqzsthreexxjvbhpfszh +five4oneqnponep31 +xlzctwonine5mxfive +8hjrqxseventwoqsfive8 +four1hcqfdvonefpfhxmssnn6 +zmhs3sevenndfx795 +fourkrlnine1 +four8mljmjmfpjscckqmxjhjnine43 +2five5threegqmgkqm3three7 +8fgnkjssix +twoonejqnfphmf77z2threebsp +57pstfv1nine58 +6fivetbvnnpb +1331gnrbthgn +2nxpxpcbzdbgnhhrskcdrsix +onegdq85 +fourcmjlrdtstwo81tpbnttcntnineoned +jrqfmvleight2ninetblfzlhnsjhdrpltnt +nineqzp8 +19qseven +fourmmgfj68pgdgvfour3 +twovkfour9five2 +1cmtgkdn1 +6sixsix +seven9sixnine +4vbhqnqsdvfour1four4ftfvpsm +dsbqseven9gshsnxxvf4ninez +2jqpdmlt +seven759 +threecxsbfourtwocnfbzkxgfb7sixeight8 +8b26twotwo +7rv4five174 +ninegdjrbzjk97 +two1ninesix +dmr96 +dpzmhthreesevensixxhqrmvlgkpmlmtm1 +5191ninetwopbbmkf6 +663nine331nine +4gjhqpfivesevens +7pmfk29dxhqgmkgxthhvsztvfour +2onenine +lmftjxtjcfour3hjqgkcd186 +twovgrrxgdj7238lvfr +7vnsklc +6sixfive9nljzpcsxzjknkjxknbjsfd +four985veight49c +2grvszbbkqjpfmvqcrktvvl +qvrscfptmr9934jx51 +58 +xfqzrsj5one +njdrlfxmrmmxtrsccgrpjcfmf25 +ninesix1 +fivevnfvfpsnxcd9eightthree +hldsrqrjtb6onehtleight2three +six3three +6sevenfour +sevenrvchgqxpbm392zvsncffrhnine +796fourtwo3frkdqzgtwo4 +ninexrxf5rjcqxqxkktfrx75four +sevenonetpfiveqpcgsnmqqkrcnmctrclptd6 +kgrnm6816pcxqnqd6gvgcsxxrs +one9rvzvlrnzhbnnknxfiveeightwols +71gxxrzbzgd65 +nzm58972one49 +626hljmxrkscqsxhzm +eightss6fivetngplspntpmsrdpbk +3nine3 +five4one +jglzllhf1cl683 +5eight34sckhhxrtwonem +eightksevenmgvhczgmqtwo1 +dpjfj4znzjznttwo +gsfbsz67threeccjtsg +six76sixsevencqtninefour +sth3sndpsvnx4 +two1mndnzjonemlvmlfive3 +zkqzhdt2rtlpf +eight8951five6 +1qxfvkbmtqvrnztnrztplqldhrmdpgtvcggsixflknn +3fgldgs6six182 +ptsrdvvzhfourmgfqseven51klvfqnine +kbktwo4lmkmseven1 +gkhpvkeightsixronethreeone2 +8six5 +frqhlvzrjrxfive2three5g +6crprnxzzvktwosixl +fgc1three9pszkbrhdpmmqnkvbsrttgfjpxg +9twoseven4kvtjxd +7five1onetwo22 +7pdjjjfcmq26four +3five4two1dbqztzfxrxfdhh +nzgtvl4tvseven +8qvcrbdvjfqvdsjlfltlzfoursevenoneeightbmvv +sixfconesix6three1sixsix +eightone9nbdrkonenine8 +3two5lbrb43nine7 +foursix5eightfivezvnbsevenjcrzhxdzfb2 +jmgnfive7ffglffpjlvbtvl935zz \ No newline at end of file diff --git a/day_1/impl.rb b/day_1/impl.rb new file mode 100644 index 0000000..a2a657a --- /dev/null +++ b/day_1/impl.rb @@ -0,0 +1,19 @@ +#prepare the input which is a string containing new lines +def parse(input) + data = [] + input.each_line do |line| + data << line.gsub(/[a-zA-Z]/,"").chomp + end + data +end + +# result should a single string or integer +def calculate(data) + result = 0 + data.each do |d| + d = d.chars.to_a + num = "#{d.first}"+"#{d.last}" + result += num.to_i + end + result +end diff --git a/day_1/impl_2.rb b/day_1/impl_2.rb new file mode 100644 index 0000000..33979be --- /dev/null +++ b/day_1/impl_2.rb @@ -0,0 +1,44 @@ +MAPPER = { + "8": "eight", + "7": "seven", + "3": "three", + "9": "nine", + "5": "five", + "4": "four", + "6": "six", + "2": "two", + "1": "one" +} + +#prepare the input which is a string containing new lines +def parse(input) + data = [] + input.each_line do |line| + data << line.chomp + end + data +end + +def find_first_digit(line, reverse:false) + line.length.times do |i| + j = reverse ? line.length - 1 - i : i + return line[j] if line[j].to_i != 0 + sub_line = line[j..-1] + MAPPER.each do |k,v| + return k if sub_line.start_with?(v) + end + end +end + +# result should a single string or integer +def calculate(data) + result = 0 + data.each_with_index do |d,i| + first = find_first_digit(d) + last = find_first_digit(d, reverse: true) + + num = "#{first}"+"#{last}" + result += num.to_i + end + result +end diff --git a/day_1/run.rb b/day_1/run.rb new file mode 100644 index 0000000..81932df --- /dev/null +++ b/day_1/run.rb @@ -0,0 +1,24 @@ +if ARGV[0] == "2" + require_relative "impl_2" +else + require_relative "impl" +end + + +def print(result) + if result.is_a? Array + result.map! {|l| "#{l}\n" } + end + + puts result +end + +def run + puts "running your implementation" + input = File.new("day_1/data").read + data = parse(input) + result = calculate(data) + print(result) +end + +run diff --git a/day_1/test.rb b/day_1/test.rb new file mode 100644 index 0000000..2142af2 --- /dev/null +++ b/day_1/test.rb @@ -0,0 +1,41 @@ +if ARGV[0] == "2" + require_relative "impl_2" + RESULT = 281 +else + require_relative "impl" + RESULT = 142 +end + + +INPUT = <<~IN +1abc2 +pqr3stu8vwx +a1b2c3d4e5f +treb7uchet +IN + +INPUT_2 = <<~IN +two1nine +eightwothree +abcone2threexyz +xtwone3four +4nineeightseven2 +zoneight234 +7pqrstsixteen +IN + +def test_example + input = ARGV[0] == "2" ? INPUT_2 : INPUT + parsed = parse(input) + result = calculate(parsed) + + if result == RESULT + puts "Test successful. Now run with real input" + puts "ruby day_1/run.rb #{ARGV[0]}" + else + puts "Test failed" + puts "expected \"#{RESULT}\" got \"#{result}\"" + end +end + +test_example