diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | data/01/example1.txt | 4 | ||||
-rw-r--r-- | data/01/example2.txt | 7 | ||||
-rw-r--r-- | data/01/input.txt | 1000 | ||||
-rw-r--r-- | data/02/example.txt | 5 | ||||
-rw-r--r-- | data/02/input.txt | 100 | ||||
-rw-r--r-- | data/03/example.txt | 10 | ||||
-rw-r--r-- | data/03/input.txt | 140 | ||||
-rw-r--r-- | data/04/example.txt | 6 | ||||
-rw-r--r-- | data/04/input.txt | 208 | ||||
-rw-r--r-- | data/05/example.txt | 33 | ||||
-rw-r--r-- | data/05/input.txt | 243 | ||||
-rw-r--r-- | data/06/example.txt | 2 | ||||
-rw-r--r-- | data/06/input.txt | 2 | ||||
-rw-r--r-- | data/07/example.txt | 5 | ||||
-rw-r--r-- | data/07/input.txt | 1000 | ||||
-rw-r--r-- | data/08/example.txt | 9 | ||||
-rw-r--r-- | data/08/example2.txt | 5 | ||||
-rw-r--r-- | data/08/input.txt | 744 | ||||
-rw-r--r-- | day01.lisp | 63 | ||||
-rw-r--r-- | day02.lisp | 58 | ||||
-rw-r--r-- | day03.lisp | 119 | ||||
-rw-r--r-- | day04.lisp | 53 | ||||
-rw-r--r-- | day05.lisp | 100 | ||||
-rw-r--r-- | day06.lisp | 59 |
25 files changed, 3976 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1761c01 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.envrc
\ No newline at end of file diff --git a/data/01/example1.txt b/data/01/example1.txt new file mode 100644 index 0000000..7bbc69a --- /dev/null +++ b/data/01/example1.txt @@ -0,0 +1,4 @@ +1abc2 +pqr3stu8vwx +a1b2c3d4e5f +treb7uchet diff --git a/data/01/example2.txt b/data/01/example2.txt new file mode 100644 index 0000000..41aa89c --- /dev/null +++ b/data/01/example2.txt @@ -0,0 +1,7 @@ +two1nine +eightwothree +abcone2threexyz +xtwone3four +4nineeightseven2 +zoneight234 +7pqrstsixteen diff --git a/data/01/input.txt b/data/01/input.txt new file mode 100644 index 0000000..c50fa2a --- /dev/null +++ b/data/01/input.txt @@ -0,0 +1,1000 @@ +5ffour295 +m9qvkqlgfhtwo3seven4seven +2vdqng1sixzjlkjvq +5twonineeight3onefive +2three2seveneightseven +eightsevenfive3bcptwo +five8six +twonineseven24one3 +one8bdxplbtfninefourspqn +nineeight3fiveseven +xmkhttr64htgvhjfivefcjlzjqrsjlfivekbcnhqpzg +261flvsthree +one2mgnphzcx45rmnffneight +sevenfivesixzvpone8f1plj +ccthpbg6six3 +f1hzds5kfdsj +qkneightwofourninejzjfmkjv8eightthdtp +eight62rvkjphrdtwoseventwo28 +eight33 +sevenkzvnkj5ftone +76sixrcznjkthreethree72nf +5nnine +3cjseventhreen +sixsix18ctxvtxbs +7mksmd9threetnkbtwo +7hxnrgnl8 +vq3dcgtlzgfives8kthone7 +76tmpjjvbzzclfour +ptwonefive2threekfrtvnbmplpsevenseven +79sixone +mheightfhllpvk6rdnrznkndp +7sixfjsspxhljrtsz39szdtsrfkh +3prqtwolcljdhcksix6three3gjkvcsz +31vjpsdqlncjone +2qhbsjcxqfive +cccgsqgj2seveneight2 +eightthree65tbhvpnthree +ltpeight27fivethxzjthree27 +m31cxstb4 +xfmnzconevzmzkcthree2 +837 +vjone779jzskrxqgkrd2 +rgd9eight +3onetwo34one +threeffthlxtmc8zfpl7fivetwo2seven +two6rxqghhnnthm +9gfjhhlc4hlpcc +glcj9zdnfkrnfcvqqhr9four +seven6564four +3lrlkmqbvllqpn7fivedmmqhk +8fivefiver3eighteight3 +3eightthree +bhzsjfivefour391753 +nine5sixsix4jrqdljfive8 +threeninenine68gkjlrh8n +7vdprdhrmbrnineonektjpseveneight +3prjtkg6three1 +nine5rnbxdsgdnine2seven +threes6 +62zzbgfq7 +5hbcvdhslxb +6msfzlhmksplcbmrqoneoneone +4sevennine3 +five99threezmxsj7sqbtthree +56vbt42three +12fjlcvkgcv +dnsdbrphqhrthmqtm7sixonezv5fgtwo +5seven5fourlhgb +fivetwo26threeone7eight3 +lxlzzhfkfive4eight2fivezqkdxczbmndvflrsq +71nineseven5one58 +fivelncljrgtxkdq51gnnpvtsbnine3five +mjlrpthgvz57skzbs24fourtwoneklr +njqlhp39five +8xxmstonetwolhlcgzcpqb +8gjqlbgfive +xcdssbrltmf8sevenkxntdzgfsv +vhgjfxeightvfvpgcxsnineninepkrjtqtseven7 +two3ztllvnrmg7fivetwo +five1jspfivethree1one +5stkpqcjhxvmrn +three3six12fourkdmlgfbflm +7sixeightnnjnc4one7four +4bqszrqnfzl9nlp +two3threesnjpncrjljpcxhjdzxqcjcjbktvxjgvnfp +36tworrhlh +43trbqvgrrsjbrxhk +eight7five +four934eight8three +9zjzhmtkt4bvljpttc25sixsix +twotwocmzcczsjz2qcslmnjl1pqfjqfhlpmtjlpzpjhffxr +4fseven +sevennvxlnineph8ninefqbm +2611five42 +two7nine +7eightfour7gh19 +71kzdvkfbqnineonetwo +onesixnine325 +5cbtbckx4vhtslbk +eightdgczsgkc5seventlsfd +xdljsnqjctzmmxcgxctdxxg73four +2shjqglxct5rctbmgvfvjfvrqsvdmthree +three71onekbksz8 +ninesevenzrcxnnbvninetwoftsvg39 +twofour36 +onerddzfgdnpkjxlbh9twojbtqk +jjcnine59lgcttxncsix +ninesevenone76zrtmvdponeprfszns +bzrxtwocqczcmkdlnjtwor7 +sixjqcgcl973one5eight +freightwo7three +dnzdrnthreemlqvrjspl79kfkfrbjm6czkzqvqp +two7953mftrgpkxjmrpvn +xone4vqljzqrspsgdhvnsgsptwo4 +2612fvhthree +one3nine +8five9onetwo +fourtwo45sixxkjgdvrpltlnrtdbbpjjmqq +four1fiveonenine6 +4three4 +qkjpskjglpeightjnc8two +eight85sixfour +53fivefive +lbmqqpdbpnppzzmttmbpkxbl6sixfour +ninemlm7 +mbvxvl2 +1vpszgjvdbd +7qd7two3onesevenkkgnnlztzxs +cqrnn1ninefxpglvtkf1 +7sixvnknzqpnhvsix6tbfnljfoursixrjzqxctmq +five889four +5rvsk7tsljtfivefour +prkhvq61clveight9dcvcfsr +four6ninenp2 +xoneight2five3fqmc6zrgcbzbzghpvbzt +sixghxgbjfivesxrth5frzxcjfivegnktshzrpmbdlp +6prgnxdseven2ggcqhc88 +five46 +4bmvzlbcsggseventhreefivesix66 +pzkljhppcmpnnng4 +ninefivemqnjsmkgtnzzstrq55 +one4lveightqjhjjzmrtwo97sctp +3vzdmk +lrzj71215 +three78ddzzmvfxfzsqtkdqtfsnk5 +db7 +deightwofour9eight63foursixcgllm +123 +sevenninegtphtjkkbhdx6sqbggcbljx4 +8qtk4 +thvml91nngfjgrsfive2three +17nine92twojkvmfrmpqhtlk +ninetworcvtjc76 +5jrzpvgchg7tlfdlbfmxj8stb +3t6sixjtnjxhxnfv +9f2skxmzgnthreenine +8sevenonethreeeightsixthree +csrcdmtmscqvqkpthreepfour86 +threeseveneightfour5zsgfour +onellbgsvseven9 +rnnkxtbnx1threekbddbpzthreerxcnbcgx +jbvlsxdxsixxjj65one5fours +kzsix4zg8fgmzc +mkfpflcpkd37 +5sixthreefivectltwo94eight +fponeight86phxr +278dmxscxb42 +five86 +63jqkh7sixnine1jmqsqtdhpg +zxchvfnvskctd9 +64sgddnvnm6five37rzhpzlccz4 +69nzlzkrkqt9ninehqrmvklgq234 +qqtc2pdzzddgjrfhcvsbrbstwo4pdl +ninegjlqdclpmgcjfdqhhsl7n +voneight6 +onevfqrnvpm9mfkgseightonemrpj +9twosixfivexz +1mlbvlninepjvn1onesixfour +1one33fiveeightfour +onevsrlmzfivefour11 +5gpfqbtn9sevenninefiveseven +8six8oner3vxgttfhtlnnine +qc1kcpnpqdthreeeightwoj +v8onefive +8eight56kkpnbzvczmkxtzkjbcm1 +1threegeightcjb5pdpz29 +ttxcmthreekdsxdfxvrclfn4sixfive69 +zgddz389 +2one344nkxtsvf762 +klncdshlrkpfrxflsncnfmtg5 +trvmkbjvreight2kdhxfvlz3ds +seven57xqrzmcsnjftfthreeonetwofive +5five686lvmlgk4twonefmr +six1khm82xronexqhzjdqzx +zldbsjcsnine6vkdslrmtnpthree2 +tbbtcl5xnsrjdz +1pqxgmnc1 +3ninefckfrppvdlmf7 +cprpq7three9twobql +fivexgjsgvpd12lzvcbpstpsprdvs +eightone2 +4threeninexhdcxrffive414 +79sxxtpxtpmj +37nine +mfmgtz32smkgxgmnk +68sevenhmchv +skjxk9shvdrznrrz5onetbdcjmk73 +865seven +4twofivesixbtqjcjthreeeight +64fxctcljfsixninedxdbthree +rgxzttr21vnvgbcfceight91 +jseven422onerzpxvgjpd +twofkktmpvcb4zngnnpdsixtwokgxcgk +xhcddkcvjpcb4354 +88eightsevenseven +2twoqpxtqlccksixthreetwotwo +vqnlmpsixvpbxdnsfive4 +fourfivefive6one +7xlkzc4 +17klxs +snml9 +ninepzvg964hqczmdfvnbvrkngrs +76nine5twosnm86 +prjrjfxffczhv4six +eight53twonine +tkjh2eightjh +k2zsfdsm +four1hlxxvgqcgvhcdcjrr68 +onethree4nine844threetwo +94twonedsn +2four3five4tgpkrjdmdfrbjddkxv +3cnsj +oneninetwo3cpfrdhnrbrd4 +2nfcbffx1qhszkhkmmeightnine8v +4three6llthreemrpztjb +53xksczcvmdsixnmxvqcctpv1 +xzhhpr66threeblplpkmktp9pgseven +seven63twoneb +9btlntpndseventwovtnplnqldthreenine +nthreeseven4five +zpktwone1gjzntpllkghhsqqsix8p +eightfourlcrkqcjfsheightfive69 +hvkv8 +four93dzrfive9eightthree8 +9fivecfour47threecpcjbf +pb1one8two +seven64twofivefoursix +hgjjjj7mkxztspmzvbdcbbfkone +mkdmqzfpkvqfcfiveshstxgnrs9fzzdr +ssddfgcd2three +xzzrrxm28seven +1nffqfjtmftwothreeninerqbthmhkhseven +lkbbgsjmbtpgncfive63 +jddsdrkmhkthreefoursixone1 +6nine5ngdcninemq7xqlsmdkgjf +eightfhppf3f9jgdvzldxltrgg2 +3nszqpfth9338six +srmhtvn46five8four +6qqttwoeightthree +threedpqxmlghsgls8sixsslthdfzdknmjeight +rtwone66four2 +six4dt5one1 +xrmlvrfpmtttvppc5 +34fivesixfivesix +1rnrtkbqlpphqlch52eight +fourgbr19 +79sixfoureight8 +kdlqxjzdx7mrdqpeightzgdx +1eight6254dplmqrpkq1 +sevenvqpnd222 +mpddrhlncrp1fivev69znxthree +87znxjsmsvlzxbfivesevenrgghkbrsdq5 +5rxbkctnsfeightxpbllldgjxqdrd3dmt +6twog48eightone +2sixfour +433onexklbhneightfour +eight5hjlmdsnzxeight1 +9fvqtc +ltmcrnhrpqtwo7five9 +six55 +mpsjhvbxmkpppfjhdjlgcrvkzpvds6htl +jldzmj671vzljbmrjtwo +rsznrsrtcz2threerk5ggdrtfmktrjjrdpjvvhshhqszzmbzp +nine53v +6khbvone +tvzoneight5khzglntxjgb +qtgx9zhtrqcnlblvrsngsfkeightninefvlnpjbxsix +tljmkjbb1kncvqsix9jthkqlkvkztjjbtrbqjxjmrblzzjfive +eight6l +47qxgjthreeeightwohp +lqponeightggj4smzdbzqg86three +75znine +nvqgzfx4five +five8pks78fourdbspf +seventczx3threeninemlsevenmvntwo +one59tqqxbjhp +six5threehgmcnpvone6bsix4 +eightsixckfpcffour4 +hbzjvzdr2five7 +one4jxz5fourm +76bbldjckqksixhcmb3 +onenine49vq +6rzxhsmnfbmqgsgvt57k1six +zdftpqqplpqfhrd16four +ninebsnjtrkfhgfbqsnqhrthree1mqkrrtxnine4 +nine3lhrzkbcmzq11 +fourthree5ninesljdvseightsix5 +8qjtbfjpf +8twobvtgbgbtnxrh5lblkxtnlphfmhpccfzz2 +brqbgn27377kltngmlqsfnf3 +twotwo67nkgmth9one +29twoonevqffqqjqsixthreeeightseven +xbrv6qgqjxmvjkr5ngjhdjlvnjsmlqgngfr +ggbmtmbcrnkj83vhhgdjlfsix4 +4blnxlvmq6zpfpgxcp38 +dcvrzvqcteighttwo3cxfn5 +qzsix5fbqbflhzzvblfhvfgmzkm8 +7twojtbdkzpsix2seven6 +6six86 +two4sbnnsskqtm +19onefourfivefoursmg7 +9rxrbxbmqs1twoseveneightthreetwo +two3zmcdnm3rlpkjqgthree +gtlkgpmpprpbbrzjrsp9ssvnzg68nine +ptwonerddxhnzfive53xhflnccpfkeight1one +sixvxlbllseven8seven81 +jhfxcvccjdsevenfive58 +5ninefourmz +one7three9threeoneonetwo +four4clsfoursixxvkzx +fourseven3 +szeightwo18l16rxcmvdmkcvb +bdzqlbthreedsb45five9 +8pztdljxbjjthreenineeightseven7crkdr8eightwocb +9krvttdxf34mrpzzchrgeightthree +8jqlmgseveneightzvxrszfsixf +ninefiveztthreeeight7l5 +7vhbjdnldvlfourhpptwo53pqbnzqnine +mxdhsixseven6 +threepzlkeight7ppdpqqlv +nine15threeqxlrngntwokhzgh +4hblzjb22 +pm6eighteightsnztcmfoureightninefive +3jffzhl +97dlrqzvfour6594oneightltg +sixlpfivelbjktk7 +three23seven +44x7twoninedrzvnfourseven +8xpndnspgbnfourzcngchbmd +gpdfptgjxcthreeptmpttnfive1 +rzcnffhslj398xrhlkbxbcgqtcsjdl3three7 +fourddqlonetwo5ms7 +zjnfvksq4djdrjtxdmnsixqshlntxn +fournpgkxtp4twojtmqgjgnzdxrnvdxfsltzpflmg1nine +one2one3 +twosixfgklbnprck26vstrjkfxgmbhhceightwomz +bxxbt5two2g7 +5gnineone8697five +vcvsfxdninecz8stcvnine +five8fivenxzcjqjxfrbmhdnthree6kkplgmthree +dtchdczdvbsevenzsb4one +78cdeightvjdlqpvql2fgrrrd61 +pvr5nineoneightzvs +8three8jvthree +2one6one +three3six +thzmsdbqthreertfjsddone7 +nmhctqdj3hlsixonevkhdbvskg +five42255 +ninefivenqmljgv3 +hjgm71 +mldfbltrfn6jxjsixpbkzbcqvcj +three8nmmp9threeeightwohft +eight9zltdfrdnrthree +3twom +5kt +pgvglmgpjtnqnkg96seven3seven +lhnnine2qjptwonine3 +eightfourllgmfkjnthreegc6bbdrfcninem +xmlckt9kkdprslxthree91nine +threespfklnine538 +qlkbjplh1 +5sevenfivefour +2ninejsjfngfhhldkkghqlmflqfbqpvtnsthgj8four +59eightthreejdzbzbfxlnjqgxxhpbhqhxv3 +threebsgqfseven4xdvnpvpnzslfsvxvshptjffn +vnnpmdqhzm61sevenfivepmbktbsdljp +379zffourxvlvpb6 +3mhlnbdqr +one9kjqtgm5hrbrxrseven +twobqssixdfz6 +f1bnhjnfzpcrsevenfour3 +ninefive1 +5oneonecfdpdqthree75 +eight7ninefivesft2cmfonefour +8fourfour +bnfive69vcqhfive5ft +9lkpj2eight9ssmsbh8three +bq9drgtone2sixfour9kthrmeightwob +eighteightgppg86 +1six1fivekmnkvlfnhsxtpthree +gqxqtdktrltmhqp4fivelbqsrklgfllrh48fxgdlcvsrc +twothree6ckkclhsnine +five5eightqfn +37threedkvtvnfs3mbmzhjbnine +hclcdxsvhzpc9onethrees +6gff5txnv7qmgptkgdrggfnlh +nnpvnstlb9hhdqjhbxkbthrzclvsbgktwo +zvkqdqmqgfivetwo334vzgvllv +7foursix +ninedfbmns5xqthree +16frxsevenpnfbgdhb +qqfcn6353one +eightpczvxnzmhkgc25ztrrqkmeight +94lnlmx2 +9mvtssn +kctwonegkprf9onefive38bjsvnnxsgpseven +4stwosevenkccc +1sbnbxzninesixfkcdfl +69eightonedsjoneone6 +8five5rrsplshtlmrj +chntvmpkdr8nsnine12one +ninefourqlxfj6cfzczseven4v +1gsbnklv6lszhmrrfvmsevenpfckscfn5 +lgt9ninekgstwovkgqckhbthree7three +ztwone91ltzmtmgpdr +1eightlqvrone +11jbvdprskhkczr32tdjmxbf1 +oneqttfcdtxbt6 +four6one8mvzqskzgnh +eight74fourcnflfncmjsix5skdqcmvtwo +jmqpvlv71 +9oneightgd +8341 +pdtmqvhzvp7 +bpfnfdm2eight4 +2fivedxlntgmgjtwooneightt +tjmvvbqmq9njjxrbmgrlcbrbtzjbone +7sixsixsix +eighttwo6bheightfour +onedtdhrsjsvflfmrkfz3d +hxbzrvj5ninenine +vdldceight7eight +twombtmnntjsfpmvjhqt2 +2eight96 +9fivegbgvtpzrg1 +5three1fjhsn +473 +np8 +kbdrczcmsbfives4two9sevenseven +ninelmrkgtfive145five +5two92eightdspeight +6zxtlvlrcl +1mkcvsctvh1eight3pmrckhbone1 +4pqrrvqsqlvsixbt1 +742cl2qnknmcxqjtklbjmsjdvdhngptpljmfour +bfsfcf92 +vzjlrffouronertfhcsmdgbjrdcd55 +knineonecmsvonetwo3 +vpnqsix2qgptjp5shdeightthree +jdp5lgffkrmsxjd8twoeightgnfzkpt8 +four6three2rq6lpseven +1pfnmmpctwovqvonebcbqjhghrbthreepdxf +kpxkgdheight4nine +839sixfive5kh9 +21seveneightmffgnmqvbfive32g +8twozncssnsllksbncbz1dgmtdljdssix +jchhdqjf1 +7six2 +onefourtwo3five +zgktwo3 +dlxdsdslhnine7 +two86 +2kjkmmjbsprfourseventkqlr +5threetwocvhlnnqhchchgl6 +gtdlffspsjhcnxqdfour6 +2gkldzksdxcnhgcdvshgxjv9rcxhh +twogjx7nine +25threeqmh9qfghrnvzb +248onefouronexcjbbqpcfb +onethree8pqkzsmlfdcfhz +74j +szfjpjbnfcjmsthree9 +99msrmcxn +1f9twoone +mrsvrhbgfone42fivethreetllzkd +rnrvx9925 +4fourzhonefive2eight +threeonetwo3nfbgnjxq +eightgz1lnqeighteight +6fivefvvtvqcjsix +djrl13 +gppmmzq5threej7pc4three +63sixhtcmp1sixtwo +fcjjzf3nxdtxnqmtjthreeonefour2 +8fpbc5 +25mrzjfppbfourfrzrspqkcbmn +1qrmkvgxnc +qvbmn7 +nine6lvdddmrfxc4two4cdhhdzthree6 +mtrjrfb6htv4mcrzqrbkthree +eight3oneseventbbdqpffnfm +eightxfll15rxkdkglxsthreethree7 +38fivethreelsixbczgzdffn +884twolp1ninetwo +csxl4one8 +dtrxqjshbfournine9two5gng +dgpvkcqzn7 +nineeighttpzfnpzdtjzseven9seven +eightnkrrnmbvqz2cvktr +55nine6kttszrtjvm +vxvzmmmnrkzvkffivetxhgj8pqtfvvlprd +43kfvtplhjfdfivefiveseventwothreezkmqlsk +gpkgckdone7xssjkmlsgddg +4fourqrspbqzzthreefour28five +one1st3kmseven +fourjqmmbone6four7gnine5 +one93mbdbtqvtqmcjxhtzst2onezhlmszqh +7krlt +dbstsmrm4onefour +vqqxjteight3 +ppndcfssbchr2vsr4xdhzvs9jbdkrh +2vdkxkqmrzveightzrgnineninentx +6one7 +three24sixsix +hthree441threemchrone +threeqhxzkpjkbthree5 +seven5hcxhlgxtr8qjtjpqnqc +2mcxlqpqqffvljnhhlplnmlq +fvbckcgjgk7two +zgglpqj92bjfvrfntsdfvffx1fourseven +jgeightwo6 +ldthsjlm6crjhxdvlqthree3 +five38threenine4dgctxdfour +mljrxk52eight3bkbeight +1mkkgnvzeightninesnr +895sixd +qqngkprp9eight +9qp1cqtkhdhdlv6hrl8eightwodln +ldgksxpnp7mxckrpftsixone3bqkktvmqsix +chtzvmneighteight5pjrdxrmdqh82 +tfr7ppsxdfvhtsdlqlmbscfourthree8bxhgtztwo +three65dnlpgcmx6 +znf69pbfsbfmxgn7four9 +5bhqfcghxssjflbzmrninesevengbqvtkgs8 +3vkdpfdkhpsix96eightgbckkflpq +drkbpmfkrrzqeightninevgznnmf9three71 +8lpl4twoneff +gvffv6229eightvbgbhzb8 +xvrzxvxmsv3oneeight8eight8 +4vfnppkqxvbxfktcltspgbnljp2 +43twobgftvc +sdpmpm4sixfourzlxkfrt7nine +eightzkxc6nzgjfgmjdfive37jcz +624fivetxvlrtnnng3 +fivefoureight5xrrvkjflbktjmxsonehlzggjkft +threextctdxfcmjsqxt9hscbhsevenfour +sdvmnpdfvsdslcqft3zhdhdbxvbkkseveneight +npzx52done +foursggcg88sixzhf4 +one2fourr +jhjgptzvjhvs8eight +cdsrpfqmtnthreesevenonefive9 +6five4four1xjjlhgsv +7nine5eightjbrdlvfphb +8ninegrhnkhsfc5pstfcrttwoone +9kpcchc +seveneightnine24 +91two +four9vvlfive3five +threedmxvdqfrhrlfour5sixngmpngxvclcjhcrseven +threethree36seven1five6 +six2five +one79581eight +xsrbppnt7nine8 +lcltq633rvzkkqxfxmonenine3seven +4two9hnjxpmft3mkzdqcvjpsmnccplcqk +6six3 +pr4eightfour2sixfivekgvstmktkcbqgz +foursevenpxgbkrmmcjbvdvqqcrdhbx1zkg +tkkl8sixvonesztkszlmzbczxgdnnkmn8 +gzptmplvxzmzjqfzrjcmjlzbfdrpfpfivesix3three +848kphtdjgqfkfourshmzjpfdpsdfzxlldz +18eightjmlzlfdch64three +8pf6 +5rt51 +9ffpmlqnbcs7lcsrbczglslhrrphbh55 +lcmllcsix7sbcrrrlfiveeight +9lbkmqrtfgxjphplc4eightfivethreesixzdpgrkptj +ltwo9 +jbklfg3oneg +1g6sixlszmvjmrf4dzvnqcbzh +8lfxxtmfqslxqjxxshqs4 +xddmf6five2 +454eightnxtlqzeight +5xgtstcbfg +2seven7dqseven5hkndsjthree +sevenncjnrvvf24threezxdzps +onetfnl1xmlqkrsjbtwo71gbscmnmvnvmjj +8three8seven27cqxzkpbdzfourhghz +4kcrthree9 +1dhsvlhzr8ngdb +cqvfmsdnone4tcfqhpdgzsixnineeight7 +three7mtwosix +5eightonefourzxlhlhxlbxds4 +8dzvdsp9xgnine +jzftwosnpgtpqt1 +pdpfive72eight +lbvvclr71zmfmqjfq8gqmmltwo +84three +eight9fourfnzxkqt5ss3 +threethreetworfqzpqfour172 +ninemzxqfzqk96df +eight7cknshzjlnlcb3kzseven +eight9seven +twok5vmxtlpdhvthreeone +6seven2nmjdbjscsevenvkdmp +sixseven8 +qslfivetwogvvlnine7ninefive +nrdcfbqczppphqvqxcd6mz +78ktndqqlrrlfourcgxpnvdps5 +sixtwo8jrkz9q +986zhdpnlmlpseven +1six676rnine8eight +threebdqknone9onefour +dmnbb39seven6 +threeqshbxpnm41two41five +mkdldph7eight7736 +sevenfour25 +p5q +263rgnrnmn97mbrjfnmgzlrgz +hmfgzqjtmhmncxthree26csfnggsmnt +8bzrjhrvdlzxnhctffoureight86sevencjtrpql +nine5twozl2seven +bsssxvkksbrgszldgpbfmxqldeight8tqmdvmdgrnclceight5 +2seven41sixnine5 +143lprjcnrzfive +2seven3 +7853 +46stkfqskgx9 +4pztjcp3pmjnnts +sixptnckh8t +84seven +815four +pxxvhzc9rtgv1dph +73foursix4nflbrsvnzmmgmfbpg67 +3nine57ninelzcsqsgrn +spzldcone17seventhreethreeqlrq +7three3zmmfvxtsdsthree +mgvmckndvnpc89jvqsix5 +fouronej34vsrzdgnm +53g25nkpgckxl +lhtzx73mhqvgflfkblfjqrb4 +eightfiveone5ktqstpvmszlhhssjbn +vgznine5s +5cgp +6cntgsl4ninemmgcsqntl9mzlvpqjz1 +cpcqqv67seven33 +9jvnlhceightvmtxddxlng5three +gcfcnpkjcj6five247zn +onekqqdjdqgnine1eightonesdx +8qzmdhp9983 +1sevenfour +qvjfzqstwo7six +2sixvzvmsc2jczxrlcq5rj +ptgqfourvqmtglcnine7three2eight +xkprfrrjqr2eight6sixdkprbtpmpjxfvxtz +oneninetwo7cdbbrrlnjk +hvbhdqnpgzsevendjggs1threeglslxpmv4eight +fiveone348five85 +87fcxflzm7 +jlkoneight9seven +kx5hjbmqg8 +vgklfrnljrbqeightfour5fhjhdhjgttxntmm +dtrkgphmlftq9threedmpbgsnsvzvsevenxnx +113nine8fourmvqqfblbgz +sdssh8nlzpgqdhvdpxc +ch2twofour26seven8 +1fivebmxpnineone3eightwojhd +6xknv3threethree3 +twostx3fourtptgklkfg +fourh9lxgnine55 +one991two2lf6 +two3jjhcmsd3sixeighttwoeight +43ms3sixthree4 +9fourfrzrgvxrmkb6onez1 +nvtjhfpbht376pp5eight +pbtclmsrkxspmmnchlm2sevenpqnksccztwo5eight +vtcjnine3 +mcvsbgbktgssgkqxs1pztwo +kvndtblmgqbkzxhmghthree47mtqqjctxtm +bjkndjfivezctcbhzpffthreeninefourseven1xmfdsr +rhgshgkmtd9 +sixtwobrnkvrlnsix7mvbp +twoninefivefive8fourvthree +kk3 +1xpjcsbnpxtwofivehqvxpgqznlthree +vbcgppkcjjxqpknfthreefivenine19n +74jfqfbsjthjkhdzk +nine86vmclcgfscreighttnmlnsvdpxlkt +3dxbsctxgntfivehlcbdzgqtxvqddsjdrjnpgjtxhc +6ftlgzrbfjeightsix5onesevenfourtwoneh +4ninezcpvppbktl35eight +four7five27nine2 +5qhbdqjcdtbsevenfivenine +99six +fourfivezhgtbmkhxrj9threehtwonebj +4threethree19threefivetjmcnvpkrfdmhjsnzlv +7sevenvxmtninefvvprtdhkhxpkth5 +qbmtvl12fiveclone4three +44fivevpqtslbxkskhftmk +ltbfourkpbgvx3nine +zxtmnh111stz +3tdvhjtfdcheightwobjf +xrn14foureightspmeightspgmvbs9 +j1 +txsmrhnzf9fiveqnine4 +31znnthgrtzf33dzxtdndbf +vdtwotwo4zjthree +17tdhvl4txhjthree9two7 +1nttq8tphmdhbvnhcfqmvtmfxm1zzdcll +991 +5zxlddbxrpc628 +91dgxjxkrxfxtgzmfourzqlvpqvdbmgxxx1 +tdk94sevenone6 +two1fivembnftwoxqqjzdfivetxxm +four5one75eight +eighteight8znlfvz7 +one3trkt77qnkgldtthree9two +fourdkgjxbf8one3three85 +gkgsldqmndfrvx1tmfchpxsfxeight +fivevxfdmlrdqseight2zc3 +32threegcznf25jvfn3five +7one86five +7vdckjfive8four7one +sixeight5gcdnine4 +vgnvsv2zhvqkbrninehfkrn87 +fkzonekghrlnmdktwo635 +8fivekrhmdnt5sevenseven +three96bcvgp4 +jhnvjp1rhrfive +fpvhhkqmgstwosix2jfour +sixqfvvbfvljmsevenlzfr5 +xpvdzngsdz3nrvkr4lvhhdvmxq +8vlxjqpvpqmqnktfive +pvgxjdb7pqk711 +pqxl3r8sixsixpstcxjtjdrns +gmmqrkfqrzddtmpnsvzkqnz3zjqbn9threenlm +2823eightfour4 +two558xqtrtrtf8tnsj +bv6twonmfttddpf +17nbtdjone48 +three6sevenzhzstnmlkf +89eightjlphdkfszlfftq44 +threenxqvz3seveneight +1lzdsevenseven3onefourtwoeight +nnd1threez8 +six9eight2nxcxplkdp8 +cd88rkbvmqqlnfqgbbq66 +2eight9cnzrk8five +onecl7 +vjfsvqfivejhbscnhqkkfk31 +fpqdkcsx6 +ninezztlsddbk3two +1xmfsfh6726threesix +6four6196one7seven +2bpsgvlgcqvsix +1464hctgxfxzb +6nhcbfour36eightwohv +9five5 +eight7dkktqkseven +pxzxsqz56fourtwofive +threednzfgdfpmr925two +kphngkzkpl867zllm95 +39threekthvvqkvm2 +seven6fsqfhltgvqnmghczlrjqnbjstsgprpxfhfphftfnp +23fourhjtvq7mp +drq9 +fkqsmgddvxhrjvvtsjlr5four6 +5ngcfsqvlcl7vbfive3 +6372cltztz +1threefiveseventhree +one5ninebfdgzhqs581 +hdqfour9 +four6jzfdkdzkrdnnshltjlt +jlqtqzm6nine2one +bbvpcplzrbmjvvtm3qhk6fivefive2 +pnclzfmfqcgmkrrtzlbptfnhlpdfsix66hjghhrmpvl +7sgnbxrkvfour4pqkpdzgmsg5three +lqgfzc9six57five9fivek +rfour9 +3sfsgzbfoursix +5sixsqddmc67fiveone93 +8sixnine +threecdgvgckq285 +sevenfivetwo58qgq +4three3eightfouronefive2p +sroneightgmcbfhpsxdvlfqcvdhhk34 +lxxhdmseveneighttwotwo5one34 +threeninevlvch3fourrvppn6 +4dgjx +twonpthklzbv8seven2lzbgktjfive +threefivesix7cnvjqpzrbv +zdonefour65seven +nine5vnmhqdntnlkfx6threeztdqpnm +2three8 +tthqsj6two +3sixfivenine4pslhjnine5 +1ckvr8 +one8bnvhglghpq +zvzbnine91fiveseven +kffpqshlljcjqqlgp8threenine2 +1fivek5qzfour +fqlthree14five1sixng7 +two74fcrvqjtc +sixsixhbztdjfcztqrsqccdzb6lfx +twotwofour4onefourgszqbqlnz +4fourcjthree +5two7eight +zdzsmflkzvxkzvzvfive6 +6vsblnxtwozjmrs +sixfour95jmzgl6 +jgbpdkmltwo1xzxvvb +pnvcbnv6jpfkdddglz +sixz95threefourninesix3 +9sixthree3three +tbzq1ninemrsfjncvsix6 +zpjxspcmzhkdchhxqcd8threesixhdhfourfxpjzfqbone +m4cnntxcthree +38onexslhfourvttrfeightsqthree +eightng6pcz +8h1jkprzqdbz9six99 +69nppconethree8 +3qvlktndrrdtjrtmnine +two62eightthreevjjmtpmmt54 +smgmnkmpktthree27nine +bdtbhgsdkjfhgrctc2trthree +six9sixthreeone +three6kssbz2sgnine +5kx88xfive +fiveeightpnfqtzcrkb22 +fivettnmjmlrlb3fourfourjxmsj2five +xeightwo9cvpbhrgqphgdsix3foureight +1nhpcsrknine +gqtxctr1lfouronetwo +3sjdmn4ninevjpqgjvmzsqv319 +joneight7zphm2hkpnine3szvjtljlqx +2sevenmmmhvxnfourvvtkpppc +vloneonethreeonenine2 +9tbsmxpmsevensix +j3sixfive6fourninethree +ltmmsrbk8zjbpht9vxfive +nine1twoxpnsvnzqm3kgkkps7 +eightthree59 +nine5six616fourzmxkjpxr4 +six42fivev +bgzteightsevencbbpfbbcrc5 +dgmfbzbmlvzfive7pqmseventhree +sixsevenfiveonehcrbsevenfive3 +twomjspbjhmlsqn42foursix +8two2seven6fourninefive +fourfivefvg1 +twofour9 +5vvlk3vfone +glrnhpdjq715ninehtone +1twosixmgrnvfmxxcfdtpjthreetwo +four21 +3bjsrzpnq49ktnmrmlgeight5bvlvqdkcnvrrbvx +four4z3eight25seven +66bkdmrjh4three7 +67zgzvldlkx2thgsbseight8seven +xknjonethreeninezjd4 +17twofour64eightfnzkcgccljnrtnf +fivebgfpbtdn5f +ddlkgjmgs9twolxhpcqh +bgkzkf5fourtlphndsxb3nine +5srkjggqxmr3seven +fourksnmcsbcxsevenbnnrnvr9five +onetwonmsixltg5jztchznvml1five +3sevenone9ninetwofive +cqzsvsqrktwo8eight681seven +six5eightx7lpvlqpcp9 +sbpbrqksix99four7six +mqcldhrjm49nine62fivethree +btskhbz7hkqnbhpnb4njbtrssp5oneonebth +2gtdvj9pbbbppkpg34dcjhbtc +mtphkzhdsix6seven +7dmsmrxfive2dmsbkhseven7 +3five6xninezfqndzmtsix +8mrh5two2 +zcpthree17ggpxmqlk +97tbtthree +tcztntvls2cnnlsixqjgkchpkmc +cjl462mdrxzzt +bbvhrqfjppsevenfive7fivethree +mfbmkd65 +3471kmrcckrqgninethree7 +2bfourtwocdhjzqvsxknine3three +ljzxxfcbfive1eight8eightkx7 +gsdcjthree1 +gmctxtr1jdsl +rrjtxqqtssix45three1five +7633 +sixbpsdone7fourrmgzjp1 +26flznhqvrcpzfbqkseven5nine9zfg +nrqgcthree15dchnrnghkntktfxl +fzvbvntrhrmcx81nvnfppmz +qrfzn1sqg +pcbvps9xhlkjnpgpfoursr6 +6v7 +six75sixninezpsjptdfhkrk +dlfgjjkfmfngfivefive5lzrcbsz +6sfgpfg +5four1bvggfs62nineone +2eightthreegvqznfjmhdxhblxf7qkxcst +seven51ldfnhlpvzn1ctlmn +jxdhkn56vmnxseven +89fjpcfklprlqkcbxjpdnp3 +lxdgnhqqgvone3 +ninesftqvgbbl4seven +4pcqqxhghsnn9two8gqrqdzjt3 +2jntsg1two48zbbclss5 +onegcgcrccvsxzvkpfqdj4oneightrgd +xrpnjjdqxxkqjqjvgsevenjnnkmxxgtl2smcbrlcceight +sixone43 +2nine1ninejrdzndmqjfourthreegnsxstzjqc2 +rtptwoone2sixlxtn3 +one4twosevenbhbmlt +xfiveeight41832 +bxgfchvjpgcmmmcchxsixcqeightskxbmscgpsix45 +fivesix17zhcvp5 +jkjmvzjmonefour73eight8fiveoneightczf +nbsjxlmdzx95 +8threeonesix5rzr +rxktdsbrr6nineseven7 +4twofvhvl3srvtcgkjm4oneighthx +39mqbdrf +8sevenseven79xqtvrznine1 +1sdckgsknfour +sevendmftpbmfzkctrfdzlhk3sevenfourhqbxcjn +hxkxzvz3147zksknjrjmvbtbrtm +xqnjh3518rtgcqggb +fnzvkdqhpmm555nljnxmdprb +97fourtwo +5xhkdtvkgvhvsthreebrvbp72 +jhl48khqkfbxjpgvprhbzp9fivepknpdthvthree +kjk6 +43fiveonetlzeight16j +one4threesix +mtsbnsgtwofourzkn3twoone7 +pmttwo45x +182twoone +jpltone6one1 +33jkrsevenseven +cbtnktlrksevenone4onesevensevensvvxjjgrx +9zzgsq34eight9eight +9five1 +threehfjkpxcvnbthreethreefour6 +fivevgtwo1rctjzcrlninethree5six +1onetwotzhvqgtpnxz1vntznz +jvvztshjdchbgkcxmjkjghth54twofourrvbl +onesix4seven7fourdgdsmvldzccqlhrxl +839hdjjplqgclx +jqtfgbxkgb368 +6sevenfivedlprsevenc +6czklmzsmxgmktzxmxsixmnlfxonetwonesgj +four28sbkrsqcdgl1three +sllmdpqvvdeight5vtvcz3kthpxgfkbgklxrfm +one5six6 +3psklrfivefvlxrsghqveight34 +6gkrrpj +32ddzqvxbpgrlndeight +nine16sixljvqjsddfstwo9 +eightmpfjpdkhhzsix23one5 +rjnlkfv9txshfcvgzp9875qtqvbjjvbggpvmpqfr +dvjnqskcqqb5pppfvgcz7one +threekllssmdxsjtwodzdcxjlk43 +fourninervscfnpgt8xkmkflvtjthree +xcvpzpfdrtthreesix2nine +onektssgthree8rjvlkpq8mfour +twoqqxgqblvmc8tqsrbs +fourthreejlgkfour6 +ninesix87 +92 +pmzqmmdh9vqvxrxbhglj7 +fourrhhhdmzcbvbldqlmb4 +rtrx3foureightsxlp2mlxtslh6five +3nineddhmnfngtfour1seven3 +lfnt5 +3kjhffpxlt2 +onefive29htsdkllvr +tbninefour4eight +18k62nine1 +seven6sevenphjfhdtnrhfsgcfived9seven +ttmtqrh3four4oneightrkv +42onekfbgxgtzl7qxzrmqbmeight +7fjkfdlmhqxtwoxcpssngss +gsntbddbnone4cjqjmspzcsxmvvthreefive +56four4one2 +cqmzqbxzfvonevmmmlxsnjr5zfg diff --git a/data/02/example.txt b/data/02/example.txt new file mode 100644 index 0000000..295c36d --- /dev/null +++ b/data/02/example.txt @@ -0,0 +1,5 @@ +Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green +Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue +Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red +Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red +Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green diff --git a/data/02/input.txt b/data/02/input.txt new file mode 100644 index 0000000..8a9d45e --- /dev/null +++ b/data/02/input.txt @@ -0,0 +1,100 @@ +Game 1: 5 red, 1 green, 2 blue; 2 green, 8 blue, 6 red; 8 red, 3 blue, 2 green; 6 red, 1 green, 19 blue; 1 red, 17 blue +Game 2: 4 red, 5 green, 2 blue; 7 red, 14 green, 3 blue; 2 green, 5 blue, 11 red; 10 blue, 3 green; 9 green, 6 blue, 13 red; 7 red, 5 green, 9 blue +Game 3: 9 green, 18 blue, 1 red; 6 red, 10 blue, 5 green; 4 blue, 4 red, 15 green +Game 4: 1 red, 13 green; 10 green, 2 red; 3 red, 4 green, 2 blue +Game 5: 4 red, 2 green, 1 blue; 4 red, 9 blue; 4 green, 1 red, 6 blue; 3 blue, 2 green, 6 red; 5 red, 4 green, 1 blue +Game 6: 6 red, 3 green, 6 blue; 3 green, 5 blue, 12 red; 3 green, 9 blue, 3 red; 13 red, 8 blue +Game 7: 3 blue, 1 red; 3 blue, 10 green; 4 green, 5 blue +Game 8: 11 green, 4 blue; 4 red, 4 blue, 11 green; 4 green, 3 blue; 1 blue, 6 red, 12 green +Game 9: 1 blue, 4 green, 1 red; 5 green, 3 blue; 9 green, 4 blue; 3 blue, 1 red, 10 green; 6 green, 2 blue +Game 10: 5 green, 6 red, 7 blue; 7 green, 5 blue, 5 red; 8 red, 6 blue, 8 green; 2 blue, 8 green, 6 red; 6 blue, 8 red, 4 green +Game 11: 1 blue, 10 red, 10 green; 11 green, 2 blue, 16 red; 4 blue, 7 red, 14 green +Game 12: 8 green, 9 red, 12 blue; 2 green, 4 blue, 7 red; 1 red, 9 blue, 7 green; 8 green, 2 red, 10 blue; 1 green, 5 red, 5 blue; 6 green, 5 red, 1 blue +Game 13: 3 green, 1 blue, 6 red; 1 green, 10 red; 1 blue, 15 red, 2 green +Game 14: 2 green, 6 blue; 1 green, 2 blue, 2 red; 5 blue, 1 green, 2 red; 4 green, 5 blue, 4 red; 4 red, 5 green, 4 blue; 1 red, 5 green, 6 blue +Game 15: 12 green, 7 blue; 19 green; 11 blue, 16 green, 1 red; 1 red, 2 green, 3 blue; 8 blue, 1 red, 19 green; 14 blue, 3 green, 1 red +Game 16: 2 green, 13 blue, 3 red; 5 red, 12 blue; 6 blue, 8 red; 4 red, 1 green, 4 blue; 1 green, 15 blue; 4 blue, 2 green, 1 red +Game 17: 11 blue, 7 green, 2 red; 12 red, 8 green, 8 blue; 2 red, 6 blue, 6 green +Game 18: 1 green, 2 blue; 2 green, 1 blue, 4 red; 3 green, 16 red; 2 red, 3 green +Game 19: 11 blue, 3 green, 3 red; 11 blue, 5 green; 3 green, 3 red, 8 blue +Game 20: 1 green, 6 blue; 4 blue, 6 green; 1 red, 10 green; 12 green; 5 blue, 1 red, 4 green; 1 green, 5 blue +Game 21: 7 green, 3 blue; 1 red, 5 blue, 6 green; 1 red, 11 green; 8 blue, 1 red, 10 green; 1 red, 5 blue, 3 green +Game 22: 3 red, 1 blue; 3 green, 1 red, 1 blue; 7 green, 2 blue +Game 23: 12 green, 1 red, 2 blue; 10 blue, 1 green, 1 red; 9 blue, 8 green +Game 24: 5 blue, 6 green, 6 red; 3 blue, 1 red; 8 blue, 2 green, 12 red; 1 green, 2 blue, 14 red; 2 blue, 5 green, 15 red +Game 25: 6 red, 13 green; 1 blue, 1 red, 3 green; 1 blue, 12 red, 10 green +Game 26: 16 red, 2 blue, 7 green; 1 blue, 7 green, 8 red; 1 blue, 3 red, 9 green +Game 27: 4 blue, 15 green; 6 green, 2 blue, 1 red; 9 blue, 10 green, 4 red; 3 red, 3 green, 6 blue; 11 blue, 7 red, 11 green; 6 red, 5 green, 13 blue +Game 28: 10 blue, 8 red, 10 green; 4 blue, 11 red, 6 green; 8 red, 9 green, 10 blue; 4 red, 9 green, 2 blue +Game 29: 4 red, 9 green, 7 blue; 10 blue, 6 green, 4 red; 1 green, 2 red, 10 blue; 3 green, 9 blue +Game 30: 6 blue, 9 green, 10 red; 6 blue, 4 red; 5 green, 2 blue; 5 green, 2 red, 2 blue; 6 blue, 8 green +Game 31: 7 blue; 2 green, 6 blue; 1 red, 9 blue, 5 green +Game 32: 8 blue, 2 red, 4 green; 6 red, 2 blue, 1 green; 14 blue, 8 green, 8 red +Game 33: 1 green, 1 red, 1 blue; 2 blue, 1 green, 12 red; 1 green, 1 red; 1 blue, 2 red, 1 green; 7 red, 2 green, 2 blue +Game 34: 3 blue; 2 blue; 10 red, 1 blue, 1 green; 5 red; 1 green, 1 red, 1 blue; 1 green, 2 red +Game 35: 10 green, 1 red, 16 blue; 4 red, 10 blue, 9 green; 1 green, 7 blue, 5 red +Game 36: 1 blue, 3 red, 16 green; 1 blue, 3 red, 1 green; 9 green, 3 red, 8 blue; 14 green, 6 blue, 3 red; 3 red, 12 green, 4 blue +Game 37: 11 red, 3 blue; 15 red, 8 blue, 6 green; 6 green, 19 red, 11 blue; 1 green, 4 blue, 14 red; 12 blue, 5 red, 8 green; 4 blue, 9 red +Game 38: 4 green, 10 blue, 3 red; 1 green, 1 red, 11 blue; 2 red, 12 blue +Game 39: 3 green, 1 red, 4 blue; 9 green, 1 red, 18 blue; 4 red, 4 green, 17 blue; 4 red, 10 blue, 14 green +Game 40: 5 red, 4 green, 8 blue; 1 green, 9 blue; 9 blue, 3 red, 6 green; 8 red, 9 blue, 9 green +Game 41: 1 blue, 9 red, 3 green; 9 red, 10 green, 15 blue; 13 red, 8 green, 8 blue; 19 red, 6 blue, 2 green; 7 green, 5 blue, 12 red +Game 42: 15 blue; 1 red, 1 green, 9 blue; 6 blue, 1 red; 1 green, 4 blue +Game 43: 1 green, 8 blue, 2 red; 1 red, 1 green, 6 blue; 7 blue; 7 blue, 3 red, 1 green; 2 red, 5 blue +Game 44: 7 green, 11 blue, 6 red; 9 green, 8 blue; 4 red, 15 green; 12 green, 14 blue, 8 red +Game 45: 4 red, 4 green; 14 green; 4 green, 2 blue; 1 blue, 12 red, 5 green; 3 red, 6 green; 11 red, 1 green +Game 46: 2 blue, 1 green, 1 red; 1 blue, 6 green, 1 red; 2 blue, 1 red, 1 green; 5 green +Game 47: 1 blue, 1 red; 14 red; 3 green, 2 blue, 17 red; 4 green +Game 48: 1 red, 11 green, 2 blue; 1 red, 11 green, 6 blue; 13 green, 1 blue, 3 red; 3 green, 4 red, 6 blue; 12 green, 5 blue, 1 red; 2 red, 4 green, 4 blue +Game 49: 5 blue, 3 green; 2 green, 8 blue; 5 blue; 4 green, 5 blue, 1 red; 4 green, 7 blue; 1 green, 3 blue +Game 50: 3 red, 5 green, 2 blue; 9 green, 7 red, 4 blue; 3 blue, 6 red, 13 green; 6 blue, 8 red, 9 green +Game 51: 2 green, 11 red, 7 blue; 5 blue, 13 red; 1 green, 2 blue, 3 red; 6 blue, 8 red; 11 red, 2 green, 4 blue +Game 52: 15 blue, 1 green, 4 red; 4 green, 10 blue, 2 red; 6 red, 18 blue, 1 green +Game 53: 2 red, 10 green, 6 blue; 4 green, 3 blue, 3 red; 17 blue, 19 green, 5 red; 6 blue, 6 green, 9 red; 5 blue, 17 green, 7 red +Game 54: 9 blue, 8 red, 6 green; 6 red, 8 green; 1 green, 6 blue, 1 red; 5 red, 4 green, 9 blue; 5 blue, 2 green, 5 red +Game 55: 8 blue, 8 red, 10 green; 3 red, 4 green, 9 blue; 4 red, 3 green, 7 blue +Game 56: 3 red, 6 green, 1 blue; 5 green, 1 blue, 1 red; 1 red, 2 green; 10 green +Game 57: 1 green, 4 blue, 12 red; 17 red, 7 blue, 10 green; 17 red, 5 blue, 3 green +Game 58: 1 red, 5 green, 14 blue; 5 green, 6 red, 7 blue; 4 blue, 8 green; 3 red, 9 green, 7 blue; 8 blue, 8 green, 6 red; 8 green, 7 blue, 5 red +Game 59: 3 green, 5 red; 2 red, 13 green, 1 blue; 19 green, 1 red, 1 blue; 19 green, 1 blue; 18 green, 1 blue, 5 red; 6 red, 9 green +Game 60: 5 red, 1 green, 6 blue; 8 red, 6 blue, 14 green; 8 green, 8 red, 3 blue; 2 blue, 5 green, 3 red; 4 blue, 1 red, 14 green +Game 61: 7 red, 4 blue, 2 green; 2 green, 8 red, 9 blue; 5 blue, 2 green, 8 red; 8 red, 1 green, 8 blue +Game 62: 6 red, 3 blue; 1 blue, 2 red, 2 green; 3 red, 1 blue +Game 63: 2 red, 1 blue, 2 green; 1 blue, 1 green; 2 green, 4 red; 3 green, 2 red; 2 green +Game 64: 5 green, 6 blue, 7 red; 2 red, 5 green, 8 blue; 7 green, 9 blue, 1 red; 4 green, 5 blue; 19 blue, 5 green, 13 red +Game 65: 3 red, 1 blue, 4 green; 5 green, 3 blue; 9 green, 1 red, 10 blue +Game 66: 6 red, 13 green, 2 blue; 2 blue, 5 red, 9 green; 18 red; 2 green, 1 blue, 1 red; 19 red, 10 green; 1 blue, 15 green, 13 red +Game 67: 8 blue, 3 red; 1 red, 12 green, 7 blue; 4 red, 6 blue, 5 green; 11 green, 10 blue, 7 red; 5 red, 9 green, 14 blue +Game 68: 1 red, 3 green; 10 blue, 1 red, 3 green; 1 green, 17 blue; 16 blue; 6 blue +Game 69: 11 green, 5 blue, 8 red; 2 red, 5 green, 1 blue; 10 green, 2 blue; 11 green, 7 red, 4 blue +Game 70: 2 green, 1 blue, 13 red; 16 green, 20 red, 4 blue; 10 red +Game 71: 10 blue, 6 green, 7 red; 5 red, 5 green, 2 blue; 7 green, 4 red, 5 blue; 1 red, 8 blue; 5 red, 1 blue, 8 green; 5 blue, 1 red, 5 green +Game 72: 2 red, 4 green; 2 green, 2 red, 1 blue; 3 blue, 3 green, 2 red; 2 green +Game 73: 5 red, 19 blue; 12 blue, 4 green, 16 red; 14 red, 11 blue, 1 green +Game 74: 2 red, 1 green, 9 blue; 5 blue, 1 green, 2 red; 2 green, 1 red, 13 blue; 2 green, 1 red, 3 blue +Game 75: 7 blue, 1 red, 18 green; 17 green, 8 red, 13 blue; 15 blue, 4 red +Game 76: 1 green, 12 red, 13 blue; 5 green, 11 blue, 12 red; 10 red, 1 green; 10 red, 2 blue; 5 red, 2 green; 2 green, 17 blue, 3 red +Game 77: 2 blue, 1 red, 1 green; 7 red; 7 red, 3 blue, 2 green; 10 green, 1 red; 3 red, 7 blue, 6 green +Game 78: 10 red, 2 blue, 2 green; 1 blue, 6 red, 4 green; 12 red, 8 green; 6 green, 8 red, 7 blue; 11 green, 5 blue, 6 red +Game 79: 7 green, 5 red; 6 blue, 2 green, 15 red; 9 blue, 2 red, 12 green; 1 blue, 4 red, 10 green; 4 blue, 12 green, 11 red; 5 green, 3 red, 5 blue +Game 80: 1 green, 13 blue, 2 red; 2 red, 1 green, 13 blue; 7 blue, 8 red +Game 81: 1 green, 2 red, 11 blue; 5 red, 3 blue; 1 green, 1 red; 14 red, 1 green +Game 82: 12 red, 3 blue, 8 green; 15 red, 9 blue, 8 green; 6 blue, 13 red, 8 green +Game 83: 4 blue, 6 green, 3 red; 7 red, 2 blue, 9 green; 6 green, 3 red +Game 84: 4 green; 3 red, 3 blue; 4 red, 1 blue, 2 green; 1 red, 5 green, 5 blue; 1 red, 5 blue, 3 green +Game 85: 3 red, 4 blue, 15 green; 9 green; 2 red, 4 blue, 6 green; 1 red, 4 green, 7 blue; 3 red, 10 green, 9 blue; 1 red, 13 green, 3 blue +Game 86: 8 red, 6 blue; 3 blue, 3 green, 15 red; 12 red, 6 green, 13 blue; 15 red, 6 green, 10 blue +Game 87: 4 red, 4 blue; 6 red, 2 blue; 5 blue, 3 green; 4 blue, 2 red +Game 88: 4 blue, 7 green; 2 blue, 7 green; 6 green, 4 blue; 1 red, 1 blue, 2 green; 11 green, 3 blue +Game 89: 1 blue, 12 green, 11 red; 3 red, 7 blue, 1 green; 7 green, 8 red; 6 blue, 2 green, 3 red; 7 red, 8 green; 11 blue, 5 red, 12 green +Game 90: 1 green, 12 red, 17 blue; 14 red, 17 blue, 9 green; 6 green, 9 red, 11 blue +Game 91: 3 green, 14 blue; 2 blue, 2 green, 6 red; 1 red, 11 blue, 1 green; 3 green, 4 red, 20 blue; 6 red, 2 green, 3 blue; 10 blue, 12 red +Game 92: 6 blue, 7 red; 2 blue, 4 red, 1 green; 4 red, 1 green, 3 blue; 2 red, 5 blue; 8 red, 6 blue; 1 green, 2 blue, 1 red +Game 93: 4 blue, 1 green, 4 red; 8 red, 4 green, 4 blue; 2 blue, 9 red; 1 blue, 4 red; 4 blue, 2 green, 11 red +Game 94: 5 blue, 1 green, 7 red; 1 green, 11 blue, 1 red; 1 green, 15 blue, 4 red +Game 95: 1 red, 3 blue; 1 red, 1 green, 8 blue; 3 red, 1 green, 3 blue; 3 red, 6 blue; 6 blue +Game 96: 4 green, 1 blue; 7 green, 3 red; 2 blue, 9 red, 16 green; 3 blue, 4 red, 11 green +Game 97: 6 green, 8 blue; 1 blue, 1 green; 3 green, 4 blue; 8 blue, 5 green, 2 red +Game 98: 18 blue, 6 green; 11 green, 3 blue, 7 red; 18 blue, 3 red, 7 green; 5 red, 5 green; 8 blue, 2 green, 11 red +Game 99: 3 red, 2 green, 3 blue; 1 red, 4 green, 1 blue; 2 green, 18 red; 15 red, 1 blue; 2 blue, 9 red, 2 green; 17 red, 3 blue, 4 green +Game 100: 9 blue, 8 red, 16 green; 3 red, 7 green, 8 blue; 1 green, 3 red, 12 blue; 3 green, 14 blue diff --git a/data/03/example.txt b/data/03/example.txt new file mode 100644 index 0000000..b20187f --- /dev/null +++ b/data/03/example.txt @@ -0,0 +1,10 @@ +467..114.. +...*...... +..35..633. +......#... +617*...... +.....+.58. +..592..... +......755. +...$.*.... +.664.598.. diff --git a/data/03/input.txt b/data/03/input.txt new file mode 100644 index 0000000..e70b8d2 --- /dev/null +++ b/data/03/input.txt @@ -0,0 +1,140 @@ +...........................775.651...............887....79...946...921...493.....942..942.....151....155.................................... +......240...................*.....-......................$..*...................*.......%.....+....................956.549.*290.......834... +.485...+............437......906......%..608.805.725..72.....242....745..61......440................................*..*.........515...*.... +..........917.......&....146........790.....*......*....*..........*.....*...............207*......................796..116......../...924.. +722...323.-................./...410.............72..748.442............384.708...............849..%............................470.......... +.....*..........................*.....271..691....-...............4*...........388.................448......&........*....848&......751..... +....370..$....639.748.......*...467....*.....*........921*909.....................*...32.....................165..452.30.................... +........984....*.....*...782........711.....50.172...............61&..........415.803.*.........524.......................203.......106*643. +...............57..433.........390....................&../.............*122...........674.........*......................................... +379..................../.........*........908..477...305.876..*..............297.415*......+.......94........../.....@378.......226..56*.... +...*..-......82.......167...936.17..958...=....*...............196......+......*.......-...380.992.............989.........29......*....301. +..124..317.....*....................*..........839.......................191.882......231.........+......976.................+......469..... +............643................*........778............541........655..............*............*........./............*.................515 +.....&............498#...&....726.774..............111....*378..................723.221.......473............752....523.638.......789...*... +.....353................518..........-.........../....*...............*88.........................*..@280..=..-....................-..297... +...........279...........................*816.....286.975.&319.....614......694.......799.......503.......861...569.............+........... +..474........*.228..............308......................................................*............207........................838..408... +...........226./....*................82.........................268/......814.........640.............../..489........719..=..........*..... +....83............88.544....250.......=...87..............199.........115*....................................*...377.@.....643........658.. +........-...651.............*................&..............................*379.....411...686.397............202.*....../........217....... +.....781.......*897......630................330.....117.961..........61..543.....#...*.....*.......323.............996.603.......*.......... +.......................................................*........473....*.....739.184.511..........+......43.833.................953...@..... +....110......@471...........*464....@.347......779................/.....205.*.......................681.....@.........................694... +.........................203......158.-....310./...449...726*982.............437.....+....259...................185......940*702............ +.....465....*.......747....................*..........*...............................238..&......./..963...755....*........................ +.....*....687..104..%.........645........959..497..732........988........733.....12...........417.176....$..........176.323....657.......... +...566........*...........938*......418......*............925....*28..............-.156........*................................*..#........ +.............933.......................*....988........../............................*........813.................868*674...375...839...... +.....................804.......464..452...................................47......324.789..........692*288.................................. +...959...........792....*10.....=......................*455.77...827.99....*.........................................166.......8...586...... +.....*...607......*..............................12.764......*.......*..905....590.236...#.677...823......972..204............*......*...... +..661....*........776....938..901.............@.*.........$...216...995...........*....382..*....#....546*.....#...........564........707... +......755................*.......*698......315..291.......964................-.......=.....865........................521........150........ +........................323............./............973.........*35..........318.....204...........546..+667....214%..*..............973... +........143......&725...........619....149..............*235..650.........604..........................*..............195..............*.... +................................*.................................926...................@240......+...433..302..672.........977....149..335. +.......880.......&...............301.512.$.....876......331.897...#..............#...............464......+...........938.........*......... +......@....942...603....&....879..........117..........*.....*.............562..905....377*862..............*56.........%........352..*165.. +.726......*..........239....*.....915..............@...661...905..............*...................466....223.................730............ +....*......97..839.......308.........*....115....512..........................497.392.....563........=...............448...........462*884.. +....122.........*...471*...........52...&..=...................=..................@.........*...............................531............. +.........*..522...&.....274...........116......*572...........907..........................161..670@..@....................=........57*..... +.........28.*.....606.......................925...............................908...86...............78..............712.....813*......16... +....549.....512....................................825.....797.......224..660*........@.425*656.........=536..256.......*........599........ +...*.............963..................842..704.............+....425..*..............................102.......$....565.179..774/........576. +...................*..........................*..............=...*....922........50...262....%............603......*........................ +.......636.......349...&...224...$............899.........983..319.............#........&...663....*575..%.......95.....383*................ +......=...............928........218................84.............964.........953..+...........212.........................857............. +............................179.......68......................&....*.................787.............92&.72....455..969...........846..40... +.993=..../..........110.407*...........%.............164..#....306.215...................552..............*....=...#.....69.602...#...*..... +......322..........#...........561..............968..*....913............%..........@586...=.330...........166.............*........863..... +............810...........157.*....557.....30.*.....774...................968.601*...........*....491..........557.....83*.................. +.......*368.*.......842...*...435.-...........65.-................................680.....913....#.......793....*.........87.262....34.-.... +....896......875.....*...........................581.957..758............$................................@..981..............#......*.844.. +..................957...150.......503................@....*......89....59......261..........653....................................372...... +...731...-129..+........*........-......................718.713....*.......197..*......30......+...476............872....................... +....*...........671....917.......................800.&......=....197..763....*...96......#.........*......%......*..........739......290.... +.....234..............................814*251....../.755.............../...375.....................309.914..816...877..=.......$......$..... +.........543.378.....74.%608.25...755..........237..............834..................431..................../..........585.................. +....408...&...*..............*................*.............214*.....................*.........89.475*.......................@..939..824.... +...*..........526..........713..&.....132...899..108.75..#..................521....428....97../.......603.....248.........878...&...*....... +....383...............873......1....................*....850....862....%......#.=................533.........*.......................863.... +.............852.........*................578%....................*..492.........905.145.927........*........437.107.....@....29............ +......604.......#./531.179..&........56.........921..233.......943......................*..........174...........*.......271.*...32......... +........*..619.............588......*............*...*..............918*837.....120.128......508...........536...............558...*638..... +523....794...-....................451..544....648..365.778.....@.............@.....*............$..%414...*............453#................. +..................&......124*...........*...............*...259........696...424...........*...............322..534................*519..... +........201*.30...474........567.526..363............%.963......287+......*.........939.964.....994.............*.....-........287.......657 +........................709*......=.........854...527................50..591...859....%..........*....196.......188..395..157...*........... +.281*....878................354.......*221...*............308....309...*.........$..@...72#......577.........................*...734.....481 +.....9....*.............658........235......767..12..548...=...#.......585..830....609........................603.130.....884...........*... +........324........@...*........................*....*........628.............................................*...$...........=......658.... +..................139.206....$.....768*........986....311..........967...15...174....100-.....7$..............962....=.........561.......... +......521.....154.............318......622...................-.............%...@.................856.......60.........24..481.......520.772. +.825..#.......*.............................180.............228.11.....173.......128......428.........405.+...68...........=..882......*.... +....*.......657...........27....798*460...................@............-..............31.*.....840...........*................@............. +.965...931............974...*...........................798.................455*.........856......*...809...97..934.740$..570............... +........*..511.$427....../..652..-297............296........$........552..........884..................*........%........*........128....... +..........-..........207............................=....641.........+..........-..*....43..........329................990...........*...... +.10...................=..11....&............................./.143........875..732....&.......&............................349.....265...858 +...*......222....495%...*...618..322.......%.........116...833....*........*.........776....288....760.........-............-............... +....291......*..........453.........*...811...398..............515........365..445....................*.....961.........433......743...$.... +.............33..................543.........@..........................=...../.....793*...........266..............668...........#.....804. +................701....................17*.................449*741.....961......814..........................*245......*...809*............. +.......206......*....668..728$............529..........*93........................-...833.713..............69.......292........157...224*... +..........*585...969............810..522............866..............254.....570........*....*.....588..................+113.......-.....752 +................................/......../......257.............119...-..844...*..979..442....169.....=.259......+.............752..401..... +...726...967........&.234.................326.....*....590*636...*............130.../.........................933.....652*439...*........... +.....*......*12..332...-...........500#..........944..............747.......$.....................203....513.......................%864..... +....389.&....................*...............938.......893....970.........864........538.755&.258..*........#...............717.96......+... +.65.....180...&.............864.....169.........*................*...390............*.........*....904.........................*...354...478 +....620......472.726.931...............*.......150../.......@....960....................*928.812...........................428......*....... +...*................*.................463..........323.....478..........964..........175.........324%........=827......66.......193..303.... +313.......................@...705.214.....174&........................-.....271........................818...............*.........+........ +........171+..830...328..158...*..%..................17....721.....568......../...........949.............*.............608.....90......570. +....327..........*....*.......44......................*..................193-.......67.................970......966.503................#.... +669*..........386..306....+............105............443...........................*........490..130...........*....$..........$62......... +......454...............&..954...38....*..........229....................643......388.671....@.......*...8......506....66*148.........$..... +......*................259.........*.................*756.......596.........*........................638..+....................%....854..... +...700......895..............................757................*.........847..............630*612..................854..606....38.......... +...............*.....93.....573......274........*...952..336...................562..................+...637............*.*.................. +945........../.814..=..........*....*...........38..=............-....&........*..................118......*.........745..855.........367... +......676..688..................604..153...............671......513...690....891.%.....101.728..........767......28...................../... +.........=.......700..222.443............114.....................................458...../....#...................*.........=............... +...........660.%...&.....*.....98.232.......*............308.......650..267/..........$............................417.....806.....502...... +.......276*....500............@.............63.......621*.....520...-........913.....225.........620.597...709*632.............663*......... +...................232...149............65.......................&........................228.....%.....-................467............800. +..........118........+....*....@.........-.458...737.....-247.........425................/..................574......424*.........421..*.... +......158.-....*........564.599......128......*...#..........................419.............764*156.............................*......996. +............577.563.....................*...777.......................508..............*827............................*465.....306......... +.........................*..............848......996*......688....154...*.......%...780......51...410......357.148..856..................... +...648.............835.713....*...609.......................&........*..885....494..........*..........661....*............................. +...-.....477./693..*........938.....*./...........642..149......465.502......$............=.523.........#.......892................=824..... +....................296...........44...707..........+.....*...................462......476........@...............*..........388............ +.....58...321..............127................................446...............................965....446........114.........*............. +.........*........951...3....*.................623.263.............=.-....122..........................=....519*...........692.......%313... +........943.......*......$....990.......795..../......*..135.....815.483....*..937*.............................634..............771........ +............460....757.....@......511/..*............564..-..............340.......109.206.......%785..148...21....................*....&... +.47.........&...............102........265......555..................182......12*.........................*...%.................788..200.... +.../............=..................#82..........$.......207.............*863.....751.........251.....641.702.......141..640................. +..........23..902.......174...............*.............=.....314...........................*..........*.....*667...........*............... +.........*...............*.......*766..842.35.......243..........*......@..................57..435....501.285.............964.....*......... +..165...100.@512.........292.......................%......79..@...726....341.511*.............*...................573..........602.74....... +...*..................................596#...&...............769........................314.397..&31................%..855.................. +...6.....673....................898..........836.......827.......+.....-..............................133*766..........*..............290... +..........*.........799........*.........629.......634........%.188.103.......594......464.799*295.............895...930.........-....$..... +.....908..504.......*......603..800..936...*......*.........768..........973...*.......*...............904*16.*................358.......... +.....@............825..%......&.........*...963.294.74...........%........*....102...967...-343.................#..................94.698... +.810...................968..............429...........*....950..313..482..397...................33.........@..297..198...114.......*...*.... +.....-............................554..................................-.......245.$...............991..282.........-...*....161..894..78... +..705.....177.....*..872@.285........*.../813.........235....729..........*287..*...472.788.645........................144.................. +.............*..984.......*........722............496*..........*990....79......715........*............456...................812..470...... +............518......@.....950.........712..............981...........................238....579.533........373.466...615/......$.....*907.. +..716..907.......761..471..............*......../...........823..+............978*......=.....*.....#......&....*........................... +....*...............*........990.331...46....871...........*.....447.723...@...............594...............801......................#757.. +...312...*.........211..........*.................90.860...970.........*...375...........*.....-....*779.........&.......................... +.......692..............602.............................*.............595.............841...166..327......-444....154....................... +..............$....316..=.............+978.843........42....135/.+332.........454.........................................707.../......295.. +.........$....743..../.......-................+........................*990..................343......#.....*...............*....684........ +......651.....................644....................887.812........187.................783........749...928.291...........131...........293 diff --git a/data/04/example.txt b/data/04/example.txt new file mode 100644 index 0000000..9bdb874 --- /dev/null +++ b/data/04/example.txt @@ -0,0 +1,6 @@ +Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53 +Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19 +Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1 +Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83 +Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36 +Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11 diff --git a/data/04/input.txt b/data/04/input.txt new file mode 100644 index 0000000..da97dbb --- /dev/null +++ b/data/04/input.txt @@ -0,0 +1,208 @@ +Card 1: 57 76 72 11 8 28 15 38 54 46 | 77 87 71 98 40 7 84 43 61 64 5 50 19 83 79 99 36 47 4 95 30 44 37 55 26 +Card 2: 44 69 14 83 54 48 21 6 20 26 | 80 26 86 3 9 4 62 34 15 87 60 88 90 29 65 46 92 73 24 12 40 10 99 37 74 +Card 3: 15 60 63 84 20 93 36 39 17 19 | 68 80 17 91 20 84 69 72 15 39 5 61 74 99 60 85 19 45 24 79 53 36 7 63 93 +Card 4: 22 74 83 58 88 46 7 52 84 5 | 75 20 95 8 37 56 31 42 73 43 40 48 4 28 99 45 90 63 81 93 68 50 46 30 7 +Card 5: 4 97 41 50 32 26 68 84 5 11 | 91 70 87 4 88 13 48 51 32 34 38 82 86 11 1 50 40 43 28 5 61 89 84 41 37 +Card 6: 79 97 39 26 57 69 38 87 60 44 | 22 92 80 38 27 66 54 2 9 62 3 4 71 99 24 97 14 7 93 28 53 50 77 68 73 +Card 7: 73 91 51 23 90 67 19 81 50 12 | 4 76 97 64 19 85 31 3 74 12 23 60 20 68 52 39 43 65 37 63 40 59 99 80 6 +Card 8: 23 64 38 82 68 79 49 56 5 76 | 68 25 64 30 40 52 16 53 95 96 85 9 4 7 26 80 62 67 73 35 32 44 90 69 93 +Card 9: 75 87 69 31 8 11 89 49 95 24 | 35 26 68 69 42 66 37 77 25 45 75 72 38 50 27 24 32 46 11 10 14 95 62 7 86 +Card 10: 37 25 47 36 57 81 44 6 79 98 | 67 34 86 70 39 97 80 69 27 17 7 50 99 84 45 32 49 53 15 95 19 18 47 37 41 +Card 11: 87 98 16 76 21 53 8 42 40 75 | 21 7 89 85 65 30 32 19 68 22 64 82 48 62 39 46 4 57 77 18 55 24 34 29 67 +Card 12: 60 11 44 35 9 56 93 91 15 32 | 31 45 37 63 26 12 15 14 48 92 81 1 97 65 29 95 57 77 99 93 27 25 58 66 61 +Card 13: 25 75 5 60 47 83 8 37 2 43 | 52 30 68 13 1 92 89 63 78 57 87 75 28 82 59 46 33 3 65 41 47 69 21 2 96 +Card 14: 64 44 89 88 1 38 20 99 9 81 | 71 68 91 21 92 75 49 22 27 12 9 26 57 13 66 45 40 37 16 4 44 90 98 85 61 +Card 15: 16 56 91 62 12 83 25 3 70 61 | 81 55 73 96 13 7 67 99 88 90 87 48 83 35 19 97 9 31 20 49 38 44 41 45 5 +Card 16: 78 68 81 18 76 41 88 45 24 87 | 59 84 67 36 33 57 42 32 11 74 65 31 54 46 72 39 98 40 16 49 79 19 3 44 22 +Card 17: 84 11 48 66 54 86 28 4 45 23 | 4 54 42 62 81 8 92 45 47 66 84 48 18 72 28 86 23 34 3 24 73 82 96 11 59 +Card 18: 46 40 41 22 75 92 68 10 52 3 | 84 73 9 22 7 19 3 65 32 6 99 77 97 63 62 59 57 17 8 68 91 28 39 4 41 +Card 19: 19 57 22 85 75 69 50 62 65 61 | 35 24 50 47 74 97 61 27 66 57 77 75 22 30 70 41 62 69 85 58 81 65 19 91 63 +Card 20: 18 13 96 41 20 44 62 97 57 52 | 18 59 96 40 23 58 20 57 41 97 44 62 75 54 85 78 94 52 64 34 37 45 84 13 53 +Card 21: 34 3 13 85 81 19 37 97 29 91 | 9 97 52 3 35 48 24 34 17 50 21 71 57 36 94 82 19 4 14 83 98 37 80 91 59 +Card 22: 18 14 95 74 23 71 31 83 51 57 | 94 14 63 18 16 73 57 31 5 23 51 69 85 45 70 35 74 49 79 27 40 95 83 13 71 +Card 23: 54 12 52 31 58 93 9 45 27 64 | 48 54 93 12 44 64 56 83 35 94 33 4 58 89 8 45 27 1 86 90 52 31 19 57 9 +Card 24: 56 75 17 67 59 37 76 94 25 36 | 24 14 56 53 82 35 92 96 17 34 25 1 16 86 41 95 64 45 38 63 31 18 80 33 66 +Card 25: 32 22 47 24 80 92 96 67 5 26 | 22 81 87 47 26 96 92 60 57 64 66 16 5 83 67 49 32 39 71 80 40 63 99 75 53 +Card 26: 62 36 66 9 3 71 75 67 29 61 | 9 31 66 82 29 41 67 71 38 36 28 76 14 75 69 61 99 57 62 88 70 95 63 10 59 +Card 27: 46 38 59 90 1 65 16 80 76 34 | 70 15 49 31 27 71 54 46 76 1 8 77 93 2 90 39 14 67 62 16 78 56 68 9 58 +Card 28: 47 85 54 21 37 14 44 73 12 51 | 78 70 14 77 98 88 25 49 9 79 58 23 52 2 43 17 12 84 59 51 56 89 47 48 6 +Card 29: 74 37 60 11 56 21 87 44 33 46 | 80 61 34 54 9 3 45 7 55 13 98 84 10 19 14 8 90 81 50 69 31 12 38 29 78 +Card 30: 29 20 44 62 79 34 52 15 49 48 | 17 84 34 1 33 9 23 55 94 10 95 69 42 79 78 44 51 82 20 25 81 29 15 13 32 +Card 31: 88 41 38 98 34 40 92 36 25 50 | 33 54 18 53 46 69 8 22 25 36 51 34 42 92 85 45 40 60 84 27 97 39 10 70 41 +Card 32: 5 28 85 29 95 37 60 34 24 16 | 74 8 48 73 34 65 66 56 64 85 78 17 39 67 92 30 75 22 95 12 29 24 6 2 51 +Card 33: 71 31 99 53 62 80 65 32 13 23 | 87 20 55 24 42 19 67 77 37 89 32 83 44 9 60 46 47 36 49 35 92 10 82 2 81 +Card 34: 78 61 12 81 96 82 7 30 80 32 | 62 8 56 89 11 12 39 31 17 18 79 51 30 92 48 5 45 78 41 44 77 98 71 67 73 +Card 35: 59 35 63 76 51 8 53 70 24 97 | 20 36 31 17 77 26 34 15 41 39 61 24 35 46 80 74 2 71 5 91 16 11 55 87 4 +Card 36: 46 51 79 66 57 52 21 11 75 33 | 88 64 74 99 22 39 42 11 14 65 1 56 86 8 26 16 72 13 55 20 60 40 19 85 58 +Card 37: 83 88 1 19 95 30 38 43 14 51 | 98 20 22 55 13 58 93 21 68 11 76 70 71 35 44 90 52 53 75 17 96 27 49 31 26 +Card 38: 87 49 43 19 16 34 88 66 67 9 | 70 46 63 58 7 53 96 1 59 35 91 85 18 21 93 68 90 73 11 92 60 61 98 38 15 +Card 39: 24 68 25 61 54 63 30 37 21 73 | 50 84 48 10 81 5 62 28 92 66 96 6 20 83 78 88 31 89 12 71 60 8 34 70 90 +Card 40: 18 72 44 15 3 19 69 63 73 57 | 14 3 52 76 71 12 50 13 86 21 55 31 27 29 43 47 90 75 9 97 6 32 96 37 18 +Card 41: 81 66 49 20 86 80 4 55 93 44 | 87 81 7 47 25 85 80 51 76 27 78 10 16 50 33 66 13 64 35 18 44 63 29 92 48 +Card 42: 27 21 14 28 69 89 94 9 19 46 | 92 13 27 99 96 19 43 54 4 14 45 16 44 83 24 61 2 28 5 90 49 51 63 64 73 +Card 43: 34 49 58 85 23 88 84 78 89 55 | 72 45 73 23 75 52 84 78 46 55 58 71 98 5 56 91 49 39 88 70 42 59 89 85 34 +Card 44: 18 69 46 58 73 59 56 23 12 40 | 71 23 87 93 21 84 10 79 47 92 91 13 52 1 32 78 59 95 72 55 97 56 43 61 75 +Card 45: 33 47 58 69 57 1 82 6 61 48 | 48 97 4 1 67 66 82 12 6 29 21 96 90 33 57 28 47 69 74 27 2 32 58 61 9 +Card 46: 42 54 98 50 36 86 27 66 29 60 | 32 23 40 62 38 91 43 98 29 85 18 30 66 28 81 35 68 61 11 27 50 22 41 46 42 +Card 47: 1 31 87 71 53 17 5 93 84 56 | 48 26 14 47 34 44 18 93 17 88 61 8 95 74 53 50 56 80 62 84 99 49 87 52 1 +Card 48: 40 75 79 29 64 57 33 49 95 68 | 7 39 63 79 89 10 23 40 22 86 92 13 57 29 9 19 90 87 58 12 77 16 75 4 91 +Card 49: 4 45 87 47 71 35 9 2 81 77 | 93 33 49 75 11 34 62 39 83 40 55 17 84 43 80 60 46 7 18 56 48 66 95 57 74 +Card 50: 88 42 2 30 24 89 15 93 16 45 | 93 45 72 68 30 28 17 82 64 91 29 98 14 24 88 70 55 48 58 10 42 83 66 2 77 +Card 51: 91 96 87 48 6 73 95 55 71 89 | 94 49 84 33 82 9 21 32 25 46 65 15 86 83 66 11 37 1 14 61 92 36 35 45 27 +Card 52: 48 3 94 56 41 13 34 8 96 25 | 40 88 46 14 68 25 75 66 87 55 64 78 92 43 19 97 53 90 83 59 69 31 84 95 13 +Card 53: 13 45 61 92 91 32 49 58 43 36 | 44 70 55 28 2 6 35 79 24 54 82 95 52 73 75 84 34 57 21 23 33 22 80 88 1 +Card 54: 61 52 20 8 73 54 83 60 29 6 | 74 40 27 46 81 75 3 42 47 69 22 59 58 49 90 63 57 50 79 70 82 5 53 91 39 +Card 55: 41 51 64 55 57 44 26 70 62 34 | 24 82 49 39 56 84 31 27 86 77 22 6 73 72 99 47 60 18 53 68 42 19 66 9 50 +Card 56: 30 89 82 17 72 46 98 5 54 58 | 4 86 18 15 84 41 16 63 44 91 12 31 66 96 94 87 49 59 67 64 80 33 5 11 40 +Card 57: 39 80 17 47 15 96 69 50 46 24 | 5 83 16 52 57 27 98 43 78 1 66 90 19 6 58 3 49 94 85 62 44 54 75 14 9 +Card 58: 42 77 37 13 74 40 31 92 36 46 | 16 74 80 59 51 31 95 85 40 93 23 15 32 18 46 97 36 13 79 10 37 99 77 25 92 +Card 59: 39 1 78 7 57 46 91 26 12 94 | 46 13 26 83 21 1 67 78 50 94 8 12 39 61 86 91 35 29 32 72 30 97 57 16 7 +Card 60: 62 32 18 51 40 96 93 36 80 84 | 42 93 65 8 2 52 84 70 11 1 92 21 80 99 18 14 17 47 56 90 49 67 19 48 97 +Card 61: 6 83 74 89 44 73 39 42 47 88 | 72 74 42 21 88 77 18 6 83 85 49 73 5 39 78 44 64 10 47 14 89 53 98 13 92 +Card 62: 91 86 35 23 30 28 77 88 56 41 | 54 26 90 20 96 78 14 5 47 98 31 55 74 83 33 15 67 92 19 40 73 72 52 81 94 +Card 63: 87 91 78 92 33 71 80 47 13 65 | 32 33 56 55 2 4 61 71 91 97 93 78 83 74 3 13 47 70 54 80 65 60 49 26 96 +Card 64: 70 61 63 52 32 35 85 46 54 4 | 42 54 32 84 56 46 29 61 63 78 4 36 80 86 26 17 3 87 48 21 85 52 35 70 22 +Card 65: 83 95 45 97 49 67 13 92 1 90 | 68 75 20 96 6 33 73 1 50 14 17 66 34 78 54 84 92 9 64 61 85 88 72 42 12 +Card 66: 1 7 99 75 17 21 48 70 30 13 | 70 80 45 89 75 7 21 99 20 54 42 46 67 85 61 17 1 16 30 92 77 48 13 68 90 +Card 67: 69 55 20 91 47 31 33 75 56 39 | 69 31 62 20 58 1 93 48 35 55 47 13 56 60 50 75 25 37 91 81 10 39 32 33 54 +Card 68: 14 97 54 28 73 64 81 32 47 17 | 86 48 88 25 47 65 22 81 28 95 41 14 27 26 46 64 79 61 45 96 32 9 21 54 53 +Card 69: 6 21 89 82 75 48 46 56 68 47 | 48 32 74 30 13 56 93 90 68 33 41 58 21 47 8 17 65 6 89 97 75 82 46 26 59 +Card 70: 35 48 78 92 64 30 88 77 76 10 | 76 33 48 67 78 64 24 69 36 14 77 85 30 73 53 91 3 35 96 88 43 84 10 95 92 +Card 71: 59 78 57 66 15 18 41 83 70 35 | 7 62 19 30 48 97 89 71 40 27 11 63 60 47 23 86 10 84 4 75 80 69 61 67 25 +Card 72: 80 82 46 70 10 14 55 49 62 9 | 31 76 62 17 8 49 19 50 85 72 77 75 42 48 33 60 54 45 12 91 20 92 15 3 25 +Card 73: 38 83 96 47 42 99 13 82 36 85 | 74 86 59 16 49 45 81 61 44 39 3 91 9 26 35 25 55 21 19 41 90 70 10 29 4 +Card 74: 92 36 96 65 24 6 98 13 33 86 | 17 83 30 5 46 51 54 81 44 99 33 56 45 14 57 34 8 16 77 48 40 94 82 73 75 +Card 75: 14 21 57 66 33 8 90 7 4 28 | 91 61 3 84 89 45 60 56 51 10 58 20 96 78 73 93 97 44 19 15 12 90 35 87 42 +Card 76: 37 91 60 44 43 3 40 33 95 51 | 24 39 81 1 46 83 97 88 87 6 67 40 22 96 93 2 71 33 29 15 41 16 89 21 68 +Card 77: 91 84 43 9 87 96 37 64 41 31 | 35 13 30 43 78 32 23 85 84 19 88 68 10 63 27 77 61 50 41 94 54 12 97 86 33 +Card 78: 9 78 53 16 80 56 91 3 62 70 | 85 64 21 88 51 16 15 4 69 30 13 1 70 17 52 23 90 5 24 50 19 81 41 67 12 +Card 79: 59 28 42 51 66 58 63 9 24 47 | 69 95 26 36 14 62 13 20 35 25 34 74 40 41 9 39 45 77 5 10 55 96 22 81 49 +Card 80: 72 83 73 23 85 2 53 22 3 43 | 14 50 67 63 19 76 39 60 31 33 62 92 29 12 49 75 69 78 44 8 96 95 34 65 20 +Card 81: 2 46 29 50 65 57 55 83 74 12 | 4 70 97 54 68 99 81 5 84 10 73 61 88 66 27 8 56 33 79 47 85 49 17 16 34 +Card 82: 37 30 10 3 8 34 44 24 57 13 | 42 17 25 65 48 71 4 64 51 83 75 27 72 96 45 18 11 15 70 53 91 14 12 87 59 +Card 83: 82 81 15 4 54 96 74 72 37 70 | 37 78 72 25 4 66 81 97 6 83 43 96 61 44 15 71 40 54 27 70 82 98 74 93 7 +Card 84: 97 52 96 23 80 53 57 83 16 62 | 5 31 89 91 84 33 52 83 76 23 64 67 10 97 29 63 96 58 74 53 62 57 80 81 92 +Card 85: 53 33 76 24 81 68 51 47 40 89 | 70 38 51 50 85 57 89 40 30 61 1 24 54 75 32 33 96 19 14 53 76 20 7 99 47 +Card 86: 19 96 52 18 15 53 82 16 86 13 | 69 27 32 85 87 30 33 83 11 47 3 21 68 70 42 61 46 2 64 65 44 1 97 48 74 +Card 87: 18 40 55 62 39 95 60 11 76 46 | 82 81 22 46 92 80 62 91 12 40 76 60 69 78 17 18 11 93 56 39 37 88 3 64 95 +Card 88: 72 65 91 61 57 4 49 24 45 31 | 28 49 91 31 19 59 65 36 34 87 72 24 60 89 17 12 57 30 75 32 63 8 21 4 25 +Card 89: 18 24 64 43 33 56 6 67 8 16 | 40 21 27 52 3 23 65 89 16 7 96 31 48 73 33 37 18 99 12 50 74 26 71 84 8 +Card 90: 75 3 92 35 12 26 49 59 60 55 | 65 58 39 73 3 56 11 44 4 47 68 24 86 10 61 6 72 13 82 42 29 93 97 77 8 +Card 91: 78 40 49 75 60 15 59 7 31 93 | 71 9 48 10 69 29 65 40 21 57 68 87 12 35 81 70 30 94 36 97 51 43 8 82 5 +Card 92: 3 53 23 43 15 4 98 11 67 29 | 35 3 93 87 83 60 5 92 1 90 67 23 78 98 20 37 81 71 31 82 95 47 53 75 21 +Card 93: 20 61 6 36 52 77 59 16 18 81 | 66 29 4 87 61 92 78 30 68 69 67 57 88 83 71 54 24 21 13 56 84 35 60 86 53 +Card 94: 25 52 87 17 94 41 23 30 72 53 | 93 62 38 77 31 24 21 36 75 64 45 83 56 39 90 29 55 43 71 54 42 98 76 74 28 +Card 95: 84 66 91 8 26 82 85 96 31 36 | 93 51 40 98 69 74 53 67 86 23 77 41 62 89 64 34 5 26 50 73 42 43 13 19 91 +Card 96: 7 6 90 39 14 73 66 81 33 67 | 63 26 1 58 29 10 3 13 94 9 85 68 69 19 53 96 90 36 49 99 31 74 54 45 77 +Card 97: 66 64 77 7 88 18 40 24 10 63 | 28 22 62 41 30 21 19 12 50 43 46 42 56 6 60 36 95 82 97 2 73 55 38 53 8 +Card 98: 48 10 16 15 93 40 37 72 57 88 | 10 59 38 19 97 23 51 40 35 31 56 54 21 27 28 81 15 67 12 57 37 65 9 22 74 +Card 99: 45 57 7 23 86 82 15 14 75 35 | 55 19 84 37 82 39 15 77 42 52 44 18 75 45 7 69 67 23 86 6 89 14 43 57 35 +Card 100: 68 85 29 69 17 44 19 56 92 8 | 8 4 20 98 36 39 78 79 72 81 51 22 13 47 2 77 30 28 64 41 89 57 50 34 16 +Card 101: 6 91 90 43 85 1 19 2 28 9 | 63 25 2 9 83 85 87 43 91 6 62 64 74 28 19 82 92 29 36 1 71 90 60 99 84 +Card 102: 20 72 12 52 58 28 30 76 42 55 | 30 47 59 29 20 93 90 33 76 58 78 28 52 83 48 72 54 42 67 17 55 12 36 2 37 +Card 103: 58 18 40 8 73 69 22 74 26 63 | 61 40 63 41 82 87 22 8 34 6 73 95 69 44 45 85 62 74 27 28 26 4 96 58 15 +Card 104: 42 71 57 39 22 79 43 80 90 37 | 43 37 76 94 40 67 4 55 74 21 7 42 3 39 28 12 80 57 32 61 95 58 64 90 13 +Card 105: 60 9 50 14 56 11 54 33 77 84 | 77 81 17 99 11 84 70 60 5 43 83 19 80 13 54 33 50 30 87 31 9 4 37 56 14 +Card 106: 79 87 86 96 1 8 63 43 39 91 | 6 2 75 63 67 38 11 96 90 91 87 97 86 9 21 77 43 36 79 8 40 85 39 1 13 +Card 107: 97 83 21 39 74 64 79 70 77 14 | 85 32 55 18 24 14 79 57 51 12 4 21 23 70 26 83 39 66 63 1 64 73 30 8 77 +Card 108: 18 41 11 62 88 38 73 4 47 36 | 82 53 41 92 65 15 42 47 85 96 26 43 58 62 11 3 54 55 89 63 30 17 20 93 2 +Card 109: 28 34 55 39 22 99 98 89 86 54 | 58 76 46 70 91 43 2 79 16 25 89 42 78 52 12 56 44 69 80 85 84 99 62 19 15 +Card 110: 32 38 50 41 8 97 84 60 92 40 | 43 7 51 76 69 38 92 34 41 71 8 49 95 79 32 45 42 58 60 40 4 3 98 31 20 +Card 111: 61 7 67 98 74 21 79 4 85 68 | 90 80 4 8 46 55 40 28 30 38 64 86 73 51 42 66 69 15 29 6 52 78 82 49 41 +Card 112: 13 92 98 37 72 52 1 30 42 36 | 17 65 49 6 5 33 40 10 57 72 12 53 7 15 44 18 90 46 81 99 26 16 23 52 66 +Card 113: 39 30 46 62 55 42 32 77 9 37 | 37 21 50 40 63 97 28 11 51 26 75 86 80 32 16 69 77 60 6 99 9 72 22 55 79 +Card 114: 54 6 72 17 56 76 23 78 7 38 | 15 76 40 56 8 50 51 97 94 64 13 3 69 24 54 66 14 25 82 1 71 41 47 74 92 +Card 115: 50 66 30 89 46 20 35 59 22 88 | 96 72 32 97 61 64 25 70 4 11 88 34 46 6 10 73 71 79 45 33 66 50 24 13 42 +Card 116: 83 33 99 22 90 32 11 28 47 85 | 80 58 57 7 15 1 23 59 86 54 67 36 83 38 34 18 37 35 19 90 45 24 46 4 84 +Card 117: 95 23 58 8 76 82 60 1 15 80 | 75 77 10 85 36 52 91 54 44 96 97 89 25 67 16 31 99 51 68 83 55 29 3 20 33 +Card 118: 53 7 99 97 39 37 80 52 18 77 | 76 78 83 34 75 69 39 14 27 44 89 56 23 30 43 48 57 61 29 82 87 93 67 62 12 +Card 119: 19 22 6 97 71 68 59 95 67 75 | 91 40 20 74 87 46 4 85 63 64 50 88 14 1 54 39 3 62 58 10 28 55 27 86 60 +Card 120: 37 76 87 74 15 84 14 11 99 60 | 24 15 92 60 25 3 86 1 33 5 62 65 79 6 91 45 11 14 10 2 43 4 68 85 54 +Card 121: 74 43 96 14 67 85 19 51 80 95 | 27 53 14 15 72 99 85 30 33 20 13 58 12 25 36 18 45 67 34 79 32 76 96 95 55 +Card 122: 93 51 95 32 2 18 40 72 31 45 | 8 98 70 17 62 22 63 72 69 73 3 26 42 25 1 41 28 13 77 92 32 60 56 2 65 +Card 123: 9 82 93 20 35 69 87 40 30 67 | 87 10 67 63 76 23 45 35 54 5 75 79 66 40 1 89 71 20 77 43 90 65 9 82 37 +Card 124: 93 48 59 54 75 8 83 35 4 64 | 71 59 41 35 4 65 49 5 98 91 54 45 76 64 93 75 8 83 48 87 94 32 16 89 82 +Card 125: 24 14 40 22 2 57 67 35 36 98 | 36 82 19 88 23 55 15 97 78 35 94 24 67 52 14 30 40 56 38 57 2 31 22 98 71 +Card 126: 22 7 97 12 95 66 69 51 59 88 | 94 88 59 58 70 64 95 29 7 93 68 21 16 19 36 39 41 66 10 76 78 82 63 34 56 +Card 127: 46 9 32 85 22 20 14 68 98 61 | 69 25 4 70 64 57 14 89 41 98 22 53 27 77 20 56 84 42 85 40 90 6 61 71 60 +Card 128: 53 84 81 45 23 13 93 34 42 80 | 80 74 39 50 75 49 7 61 43 5 1 51 36 54 57 97 26 32 82 98 68 45 93 37 86 +Card 129: 40 29 85 88 86 7 49 67 91 92 | 86 38 79 31 57 34 78 17 52 53 22 36 62 75 21 70 88 7 3 49 28 6 85 14 4 +Card 130: 63 20 36 62 43 98 99 12 46 57 | 14 32 99 22 17 70 5 91 57 95 49 15 28 46 84 89 78 79 43 98 45 50 88 16 23 +Card 131: 7 16 87 36 73 82 11 40 14 69 | 25 31 82 24 50 38 2 28 4 23 72 6 51 79 86 46 55 97 42 90 84 1 39 32 27 +Card 132: 67 56 15 63 40 9 59 23 94 27 | 26 65 80 40 46 23 37 78 27 12 34 98 41 59 94 16 50 79 90 15 4 7 6 62 17 +Card 133: 18 91 27 52 4 34 12 32 65 41 | 45 55 7 3 84 79 54 91 75 80 17 49 42 9 18 48 59 6 8 22 94 10 93 53 57 +Card 134: 78 75 48 26 14 8 91 41 34 68 | 18 29 57 5 17 22 56 97 74 34 13 50 40 33 62 20 10 71 58 1 21 88 87 8 25 +Card 135: 5 97 16 92 74 51 61 65 3 14 | 15 50 86 24 99 90 59 32 45 81 97 75 6 25 29 80 9 89 46 70 40 57 42 63 60 +Card 136: 81 35 23 70 51 14 31 50 67 7 | 32 28 40 58 4 99 18 95 11 90 86 13 84 74 61 5 44 47 24 38 21 1 77 48 78 +Card 137: 74 99 57 81 5 1 90 9 69 30 | 88 23 97 7 25 68 78 91 53 15 55 81 92 90 12 18 50 71 61 75 8 76 36 19 34 +Card 138: 37 2 84 13 78 51 29 15 42 71 | 49 30 16 88 79 67 76 75 38 80 91 6 28 83 14 26 1 19 40 18 32 98 74 17 44 +Card 139: 49 75 16 61 39 4 51 55 17 97 | 11 45 56 47 81 78 67 21 57 42 84 58 8 13 10 91 7 19 46 14 90 87 26 1 18 +Card 140: 39 19 41 45 17 30 29 66 61 25 | 61 53 29 41 37 30 95 93 45 17 8 21 66 10 14 78 65 18 39 5 52 91 19 25 4 +Card 141: 7 66 29 40 9 14 34 64 4 31 | 98 63 65 6 92 56 81 67 48 88 49 18 38 61 13 95 28 85 20 17 21 30 58 52 89 +Card 142: 32 88 54 27 21 86 49 87 44 45 | 15 44 67 75 87 79 21 10 34 70 54 49 88 3 28 32 65 27 43 98 53 64 45 86 9 +Card 143: 14 7 67 53 37 73 45 18 62 34 | 87 68 3 22 40 86 26 85 70 4 61 78 1 29 48 12 37 10 77 54 99 36 94 79 15 +Card 144: 92 35 52 27 19 16 58 4 22 85 | 47 37 30 51 96 28 58 81 85 9 19 10 46 22 27 7 35 52 16 60 4 92 53 13 84 +Card 145: 71 32 62 83 43 20 97 57 78 24 | 88 34 23 25 67 52 11 9 49 80 70 29 43 2 44 45 62 56 33 3 20 98 28 77 79 +Card 146: 99 11 17 93 16 77 1 46 55 68 | 25 17 77 99 35 53 3 84 98 2 21 74 27 58 16 20 33 22 39 28 69 9 92 46 52 +Card 147: 56 26 30 23 66 94 82 47 14 49 | 68 41 6 13 99 7 71 67 35 93 57 84 44 40 70 89 42 63 74 22 20 55 33 91 64 +Card 148: 21 6 43 36 7 44 61 23 93 57 | 53 20 51 59 74 77 16 92 47 25 62 58 18 85 3 63 46 81 99 5 79 70 69 75 34 +Card 149: 31 36 91 20 17 50 1 18 64 52 | 66 90 80 33 26 24 30 58 45 77 25 29 44 48 6 35 96 13 78 65 68 98 93 89 94 +Card 150: 81 91 37 66 12 33 59 97 38 32 | 61 38 91 95 75 85 48 44 37 47 84 66 35 62 79 94 25 22 97 17 10 31 96 5 78 +Card 151: 32 35 11 75 63 61 42 62 10 56 | 4 44 53 12 50 76 51 5 82 25 30 8 89 41 34 98 54 96 37 74 35 16 31 57 65 +Card 152: 96 60 29 43 99 19 80 8 5 2 | 87 52 19 11 99 35 20 60 55 80 24 21 8 61 38 78 42 28 95 6 64 65 49 59 26 +Card 153: 53 30 75 13 87 77 56 89 63 6 | 7 54 93 80 47 4 72 9 69 44 97 96 23 24 94 67 55 8 33 30 37 6 14 5 3 +Card 154: 10 65 46 58 13 25 69 52 19 3 | 47 41 9 3 40 79 89 21 33 73 14 7 74 65 31 62 24 69 60 87 12 16 53 80 82 +Card 155: 24 51 35 95 93 73 36 65 27 20 | 14 83 97 94 29 39 19 38 33 32 44 92 60 25 76 64 49 71 65 34 91 31 53 74 23 +Card 156: 52 31 50 54 82 42 23 9 39 3 | 29 64 88 70 48 74 12 90 75 57 23 25 58 68 36 33 73 5 84 28 47 92 50 41 21 +Card 157: 66 20 50 96 6 84 54 67 59 81 | 77 60 38 65 37 44 15 73 23 83 18 71 89 53 90 36 40 32 2 39 78 63 8 51 19 +Card 158: 38 46 85 81 87 86 98 90 37 34 | 41 71 35 26 12 19 51 93 39 20 76 24 7 80 50 56 49 2 57 84 68 92 54 1 75 +Card 159: 61 36 84 47 4 22 49 17 31 75 | 77 83 49 55 84 80 18 44 31 47 22 67 4 68 69 35 75 5 59 13 61 39 36 54 17 +Card 160: 90 70 62 65 87 95 15 77 76 35 | 70 94 97 10 90 80 35 27 84 87 42 62 54 26 95 57 82 63 1 18 92 25 49 64 21 +Card 161: 44 6 28 50 79 16 15 83 45 53 | 79 72 12 45 50 35 67 6 89 28 15 61 16 7 46 36 44 55 27 92 1 59 83 53 94 +Card 162: 29 51 46 64 4 75 37 78 81 71 | 83 71 37 39 74 66 32 1 51 93 43 46 20 3 15 50 81 64 75 73 78 29 33 4 22 +Card 163: 1 52 37 97 88 47 94 10 98 5 | 85 31 33 46 15 1 16 61 98 59 64 94 83 68 35 11 44 80 38 36 84 72 86 40 29 +Card 164: 60 40 94 62 18 71 92 25 21 64 | 64 18 58 76 38 55 40 45 71 92 73 75 25 62 12 94 68 79 23 91 21 60 72 39 7 +Card 165: 63 88 91 22 85 18 39 55 33 84 | 95 88 37 5 39 46 33 61 32 45 74 20 27 35 76 85 84 18 54 86 91 75 22 55 63 +Card 166: 72 11 31 50 53 82 41 74 62 87 | 42 34 50 11 96 3 77 7 37 22 44 38 62 1 87 68 12 54 74 53 47 82 69 89 85 +Card 167: 79 26 70 95 25 16 18 37 75 61 | 39 11 68 61 44 53 42 94 37 45 75 78 62 18 95 26 79 92 38 13 16 64 21 91 57 +Card 168: 94 86 69 88 31 15 62 44 19 14 | 3 24 29 8 44 61 89 7 75 15 91 36 45 70 66 4 35 6 71 22 25 39 55 33 18 +Card 169: 86 68 72 15 42 99 9 35 2 74 | 42 84 59 86 6 15 53 89 85 79 20 68 62 61 10 2 9 51 99 54 33 35 13 48 93 +Card 170: 83 6 15 80 93 63 79 50 69 5 | 15 25 6 93 69 50 83 68 16 40 66 58 63 79 52 7 80 34 61 95 5 33 78 91 32 +Card 171: 33 85 4 12 72 62 49 67 17 53 | 4 17 53 72 47 6 49 56 82 48 12 26 30 85 61 15 36 70 64 25 2 33 67 46 62 +Card 172: 98 63 26 82 12 61 56 95 27 99 | 76 30 14 95 26 97 71 19 57 67 73 48 63 54 82 18 98 27 61 5 12 44 1 56 74 +Card 173: 7 32 34 4 22 79 27 10 78 65 | 3 81 65 36 91 62 94 54 41 32 12 28 39 34 18 61 78 79 80 66 9 63 43 72 97 +Card 174: 14 78 60 32 26 31 15 80 11 72 | 1 31 33 35 73 83 97 36 21 3 26 9 91 23 51 84 82 70 22 20 34 90 98 87 69 +Card 175: 73 14 7 11 20 64 30 90 62 23 | 60 53 15 73 63 19 71 92 48 89 80 44 78 79 2 76 45 64 42 35 81 27 10 21 26 +Card 176: 32 30 39 10 1 3 67 66 94 62 | 86 95 56 54 58 35 90 19 74 43 5 48 17 2 46 65 97 71 36 31 69 8 47 94 42 +Card 177: 24 90 40 47 51 75 63 29 57 10 | 49 68 61 43 30 26 84 59 99 75 44 41 17 24 12 38 90 37 36 35 91 9 89 46 8 +Card 178: 73 74 31 76 10 21 70 3 30 41 | 39 14 30 70 79 75 97 44 87 20 92 12 86 56 18 46 8 90 23 98 2 59 28 53 3 +Card 179: 78 44 89 84 50 97 55 90 77 99 | 79 1 88 65 2 50 72 68 7 15 85 41 64 93 37 16 53 44 42 48 89 97 59 60 8 +Card 180: 55 98 13 45 33 91 88 4 49 37 | 18 44 64 83 56 79 81 26 78 54 72 75 11 70 66 57 73 61 62 34 19 95 93 94 76 +Card 181: 94 47 65 55 8 45 1 67 71 25 | 99 34 43 64 36 50 6 51 27 59 37 40 3 98 72 78 38 74 82 46 85 90 48 32 84 +Card 182: 78 75 63 31 30 70 84 50 28 19 | 61 18 58 87 77 48 71 50 91 92 60 86 73 94 85 57 97 15 1 25 74 67 11 68 47 +Card 183: 94 27 68 41 8 72 48 85 97 49 | 81 35 90 69 76 18 53 1 59 25 88 31 4 93 84 32 9 55 66 50 22 62 43 60 17 +Card 184: 40 31 56 54 59 98 93 81 24 44 | 62 42 93 56 99 10 81 59 37 6 41 66 44 72 31 30 20 54 51 24 27 83 40 73 98 +Card 185: 38 73 79 48 3 46 99 93 50 24 | 65 34 40 2 20 92 10 32 67 57 22 47 96 11 7 31 87 6 28 95 77 25 58 29 27 +Card 186: 47 65 99 98 90 68 13 49 51 10 | 90 82 27 68 84 83 57 50 18 5 49 65 85 10 46 13 21 81 73 51 71 47 98 88 99 +Card 187: 25 56 18 15 59 47 20 86 50 83 | 25 57 83 36 56 87 50 34 9 70 4 64 77 45 92 13 20 47 48 15 97 18 86 28 59 +Card 188: 99 16 44 2 85 17 71 45 49 11 | 94 13 45 36 77 89 26 6 39 27 84 1 80 21 73 41 33 90 46 72 65 96 34 71 83 +Card 189: 34 24 76 68 47 19 85 15 50 46 | 43 67 4 44 14 34 19 61 47 68 50 46 99 94 16 76 15 28 36 27 52 85 88 24 89 +Card 190: 56 20 43 86 2 88 87 30 14 4 | 43 14 19 92 3 23 87 74 50 97 2 88 18 80 20 86 36 41 95 27 57 98 49 30 26 +Card 191: 47 2 18 84 91 66 24 6 42 56 | 12 93 7 50 42 45 2 91 66 4 32 47 19 56 49 18 15 24 44 84 97 6 16 31 25 +Card 192: 42 88 68 56 93 48 9 52 20 70 | 30 93 42 4 68 70 36 56 9 15 88 98 64 67 33 91 20 61 50 27 13 94 52 48 85 +Card 193: 46 57 19 40 9 7 47 33 86 11 | 65 54 38 43 82 55 79 51 77 73 74 97 75 96 6 47 62 88 92 18 84 48 41 29 52 +Card 194: 58 23 35 79 82 72 44 93 12 43 | 43 60 2 24 77 48 61 25 44 75 35 12 93 51 36 72 6 31 29 50 37 80 19 14 87 +Card 195: 15 77 78 50 36 83 68 52 86 26 | 16 72 67 88 14 81 34 24 71 32 91 77 90 1 98 95 7 28 49 84 86 20 44 73 56 +Card 196: 25 3 32 15 1 56 27 51 82 81 | 87 79 15 11 98 54 56 88 18 92 69 25 66 27 60 58 44 1 51 3 32 81 12 72 41 +Card 197: 3 99 81 8 93 28 76 7 27 48 | 78 98 85 5 93 77 72 62 69 82 50 9 35 74 18 10 33 67 90 31 79 84 58 29 17 +Card 198: 26 81 19 24 59 82 8 95 86 17 | 13 22 10 96 19 20 88 3 90 78 24 9 50 34 6 94 7 60 44 76 31 81 26 33 43 +Card 199: 77 91 58 16 47 94 23 30 88 5 | 38 66 12 25 95 67 72 89 36 45 63 15 54 98 74 57 32 39 59 28 7 62 82 13 26 +Card 200: 82 47 52 12 83 4 26 93 33 9 | 31 30 91 2 6 27 28 1 81 8 75 92 56 57 41 24 72 85 53 74 59 11 66 32 54 +Card 201: 4 13 26 57 84 17 63 10 98 56 | 72 85 68 47 44 60 54 34 38 16 8 11 23 84 32 18 69 13 26 35 9 73 43 15 89 +Card 202: 11 9 1 42 71 78 97 89 8 10 | 33 17 81 48 60 96 69 37 12 46 73 4 76 54 86 91 28 5 51 98 99 84 13 85 32 +Card 203: 37 80 7 87 79 60 6 49 16 12 | 23 34 15 46 38 20 27 45 33 97 37 14 68 83 49 79 43 70 57 60 11 63 24 35 73 +Card 204: 84 24 48 76 7 18 77 37 69 5 | 88 39 92 94 34 37 11 40 85 35 2 81 73 58 42 66 83 9 56 12 14 51 62 20 7 +Card 205: 5 84 4 6 95 77 59 67 74 35 | 58 47 29 34 79 86 35 89 71 96 27 64 90 48 37 78 1 39 46 21 98 91 43 8 56 +Card 206: 56 21 34 13 1 17 99 11 76 60 | 36 24 83 31 50 19 82 32 61 9 98 71 79 39 97 37 29 13 27 10 52 22 41 40 59 +Card 207: 62 7 22 90 51 96 12 13 36 52 | 48 37 70 24 73 51 83 3 5 77 29 87 23 18 26 76 19 97 20 86 84 14 63 33 21 +Card 208: 40 42 5 91 29 59 70 49 23 94 | 82 81 30 61 64 65 19 9 67 75 92 16 26 52 73 43 55 35 17 93 39 90 74 53 51 diff --git a/data/05/example.txt b/data/05/example.txt new file mode 100644 index 0000000..f756727 --- /dev/null +++ b/data/05/example.txt @@ -0,0 +1,33 @@ +seeds: 79 14 55 13 + +seed-to-soil map: +50 98 2 +52 50 48 + +soil-to-fertilizer map: +0 15 37 +37 52 2 +39 0 15 + +fertilizer-to-water map: +49 53 8 +0 11 42 +42 0 7 +57 7 4 + +water-to-light map: +88 18 7 +18 25 70 + +light-to-temperature map: +45 77 23 +81 45 19 +68 64 13 + +temperature-to-humidity map: +0 69 1 +1 0 69 + +humidity-to-location map: +60 56 37 +56 93 4 diff --git a/data/05/input.txt b/data/05/input.txt new file mode 100644 index 0000000..d93c0e7 --- /dev/null +++ b/data/05/input.txt @@ -0,0 +1,243 @@ +seeds: 1514493331 295250933 3793791524 105394212 828589016 654882197 658370118 49359719 4055197159 59237418 314462259 268880047 2249227634 74967914 2370414906 38444198 3291001718 85800943 2102534948 5923540 + +seed-to-soil map: +3352941879 1247490906 129850502 +1738919961 2189748071 56658550 +1795578511 292133467 518088747 +1519757661 1666834550 130335907 +1650093568 133993362 88826393 +2813914030 2262539545 40894545 +2698412916 2661705133 115501114 +2854808575 810222214 437268692 +410530961 1545057218 121777332 +0 242661076 10731898 +532308293 2303434090 61476099 +3292077267 1797170457 2282798 +2313667258 0 133993362 +2447660620 2410952837 250752296 +3294360065 253392974 38740493 +10731898 1377341408 167715810 +1457582089 2364910189 46042648 +593784392 3009289500 824592362 +3333100558 222819755 19841321 +1418376754 1799453255 39205335 +1503624737 2246406621 16132924 +178447708 2777206247 232083253 +3482792381 1838658590 351089481 + +soil-to-fertilizer map: +3513795976 4258851234 36116062 +3393453635 4148223693 110627541 +3504081176 3494735450 6350258 +2671742993 3596285367 235915393 +991290653 256764866 25867175 +2907658386 3330719253 68855819 +3336496635 4091266693 56957000 +3161141476 2536943456 80523019 +1961696534 304660310 29551079 +812996514 1560772632 178294139 +1562163347 2321959023 78904062 +31289107 1039870587 339682886 +1520029818 1928417376 42133529 +3510431434 3832200760 3364542 +3549912038 3272523584 58195669 +0 149071717 31289107 +3608107707 3501085708 5732766 +503523937 1739066771 189350605 +3071674583 3506818474 89466893 +3241664495 3996434553 94832140 +1708133363 454333361 253563171 +3813493721 3097084118 175439466 +1991247613 1970550905 351408118 +3613840473 2897430870 199653248 +2536943456 2762631333 134799537 +1641067409 244319429 12445437 +3994753216 3913095788 83338765 +2976514205 3399575072 95160378 +1354883134 0 143118415 +1349131883 2400863085 5751251 +1498001549 282632041 22028269 +2342655731 180360824 63958605 +370971993 1379553473 126598642 +4149802438 2617466475 145164858 +1017157828 707896532 331974055 +692874542 334211389 120121972 +497570635 143118415 5953302 +3988933187 3907275759 5820029 +4078091981 3835565302 71710457 +1653512846 1506152115 54620517 + +fertilizer-to-water map: +3053686523 2028998994 1241280773 +1492748555 1562401968 269616514 +554432178 1000324407 562077561 +2944878746 3270279767 108807777 +2501520804 3379087544 52288887 +1762365069 20686928 69653413 +2028998994 3431376431 472521810 +1431309984 814973200 3653900 +409832614 0 20686928 +430519542 818627100 123912636 +1116509739 500172955 314800245 +2553809691 3903898241 391069055 +0 90340341 409832614 +1434963884 942539736 57784671 + +water-to-light map: +2774754469 1598606098 15160294 +3832622498 1469118874 129487224 +4125818569 3997047227 169148727 +1108418694 1130695768 196125912 +637654660 517892123 26551592 +2519230072 3399515763 135968347 +2751000257 3126996880 23754212 +861800165 884077239 88532605 +1469118874 2566660966 63929427 +2789914763 3150751092 63425583 +2853340346 2561960449 4700517 +1692681911 3397592997 1922766 +2858040863 1773257241 287341147 +2655198419 2851614649 15098309 +950332770 972609844 158085924 +591049922 471287385 46604738 +3482333989 3849276196 108901632 +1694604677 1613766392 159490849 +3591235621 3958177828 38869399 +3630105020 4166195954 128771342 +3205039781 3535484110 277294208 +2706794606 2060598388 44205651 +386607659 544443715 110595292 +3962109722 2540862463 21097986 +697311924 0 92263281 +558450415 404456802 11447837 +2409200012 3214176675 110030060 +569898252 862925569 21151670 +1354525884 415904639 55382746 +789575205 790700609 72224960 +3832262624 2690248164 359874 +163757080 181606223 222850579 +1533048301 2967363270 159633610 +497202951 784452458 6248151 +2670296728 3812778318 36497878 +3145382010 2630590393 59657771 +1854095526 2104804039 436058424 +0 655039007 74414138 +2390804262 2690608038 18395750 +1304544606 1326821680 49981278 +3758876362 3324206735 73386262 +664206252 1376802958 33105672 +74414138 92263281 89342942 +3983207708 2709003788 142610861 +503451102 729453145 54999313 +2290153950 2866712958 100650312 + +light-to-temperature map: +2054128675 422374783 216418447 +3729049939 3132111492 565917357 +524183620 1261361039 34450583 +723901655 638793230 74616934 +304496246 795175951 115896188 +1128506994 1008723417 50927515 +958650763 2074746732 3056214 +0 1224918384 36442655 +558634203 1059650932 165267452 +2052385426 713410164 1743249 +833053864 1953862956 120883776 +36442655 715153413 80022538 +1455705971 1506174459 386316618 +1842022589 1295811622 210362837 +2270547122 2077802946 24477429 +116465193 2102280375 188031053 +1179434509 945607414 63116003 +798518589 911072139 34535275 +3373647615 3893335786 195498774 +3696979816 3698028849 32070123 +1242550512 1892491077 43410067 +3051130577 2566857633 322517038 +3002478931 3844684140 48651646 +2311039190 3730098972 114585168 +2425624358 2311039190 187630064 +2819387158 2889374671 183091773 +1285960579 103791186 85466201 +1371426780 338095592 84279191 +1110545182 1935901144 17961812 +953937640 2290311428 4713123 +420392434 0 103791186 +961706977 189257387 148838205 +3637334768 3072466444 59645048 +3569146389 2498669254 68188379 +2613254422 4088834560 206132736 + +temperature-to-humidity map: +2032423062 2486277941 26281270 +333062067 2316624216 6051173 +1716048249 1385455997 91409968 +460397469 2512559211 69041956 +25538975 668468772 15388105 +2090913379 324344034 71221218 +2804805674 3018690414 130533369 +529439425 908821722 476634275 +1106765273 448560048 219908724 +2162134597 1476865965 445565302 +0 395565252 25538975 +4004204691 4019550481 43244121 +2058704332 0 32209047 +1516375281 2116951248 199672968 +3888833667 2764269134 115371024 +40927080 32209047 292134987 +1490276549 2581601167 26098732 +1360818538 2322675389 129458011 +1006073700 2043715496 73235752 +1079309452 421104227 27455821 +1807458217 683856877 224964845 +339113240 1922431267 121284229 +4155917040 2879640158 139050256 +2764269134 4171262830 40536540 +4047448812 4062794602 108468228 +2935339043 3149223783 870326698 +1326673997 2452133400 34144541 +3805665741 4211799370 83167926 + +humidity-to-location map: +3928575650 3147563455 98804874 +2357899446 2418187254 26586982 +449562184 2261875136 59054833 +308294839 60287808 141267345 +1872062279 1591999301 10857495 +1227084719 574109504 259895254 +1980177059 1765508840 13399403 +1162615704 1941046629 64469015 +2384486428 2654234915 114059261 +702311863 1515542756 40659242 +1993576462 2005515644 256359492 +3047301127 3246368329 27789688 +650396000 1713592977 51915863 +3701335066 3862068622 181049310 +1122863338 1673840611 39752366 +3075090815 4174917460 120049836 +3882384376 2778717800 46191274 +1626219043 201555153 245843236 +4027380524 3325898523 267586772 +3417979817 4043117932 13866284 +3281454033 2925002624 18592540 +110359150 1556201998 35797303 +2558833497 2444774236 209460679 +508617017 834004758 141778983 +1574315753 975783741 51903290 +2249935954 1027687031 107963492 +0 463750354 110359150 +2778717800 3593485295 268583327 +3195140651 2824909074 86313382 +3445626269 2943595164 203968291 +3324037823 4080975466 93941994 +742971105 1135650523 379892233 +146156453 1778908243 39038597 +3300046573 4056984216 23991250 +1503331938 1602856796 70983815 +185195050 1817946840 123099789 +3649594560 3274158017 21920411 +1486979973 447398389 16351965 +3671514971 3296078428 29820095 +2498545689 0 60287808 +3431846101 2911222456 13780168 +1882919774 2320929969 97257285 diff --git a/data/06/example.txt b/data/06/example.txt new file mode 100644 index 0000000..28f5ae9 --- /dev/null +++ b/data/06/example.txt @@ -0,0 +1,2 @@ +Time: 7 15 30 +Distance: 9 40 200 diff --git a/data/06/input.txt b/data/06/input.txt new file mode 100644 index 0000000..5dd51e5 --- /dev/null +++ b/data/06/input.txt @@ -0,0 +1,2 @@ +Time: 50 74 86 85 +Distance: 242 1017 1691 1252 diff --git a/data/07/example.txt b/data/07/example.txt new file mode 100644 index 0000000..e3500c3 --- /dev/null +++ b/data/07/example.txt @@ -0,0 +1,5 @@ +32T3K 765 +T55J5 684 +KK677 28 +KTJJT 220 +QQQJA 483 diff --git a/data/07/input.txt b/data/07/input.txt new file mode 100644 index 0000000..755455f --- /dev/null +++ b/data/07/input.txt @@ -0,0 +1,1000 @@ +6A868 562 +KAKKA 232 +39399 272 +2J722 48 +5AQ36 444 +33633 619 +92QAJ 960 +TQ67J 879 +KT252 69 +AA9TA 702 +7Q3J3 421 +348T4 628 +533J5 264 +J88JT 636 +2T823 282 +37736 695 +JJQQQ 853 +4KA37 89 +4422J 152 +Q4646 149 +T2AQ7 819 +K3J39 730 +J88A4 329 +J647K 867 +J8Q47 584 +7J778 158 +99995 778 +624K7 113 +2KQ22 616 +73T3T 474 +44A3K 507 +4K649 206 +33683 565 +6T9T9 955 +6Q6K6 850 +TK5AA 157 +88228 868 +88222 787 +A778A 574 +T55AA 646 +393J3 246 +799K4 690 +63283 685 +86666 878 +TTT6T 948 +A8746 127 +QQ9QQ 428 +9J4AJ 248 +TA9TT 1000 +AQ853 546 +2A856 875 +K6666 683 +K3KK5 996 +T28J3 477 +5928T 74 +Q3467 491 +2J56J 177 +KKA6K 936 +9K239 626 +22A22 293 +A74Q5 688 +7J737 752 +JK73K 214 +AJJ97 986 +88585 260 +3Q4A7 107 +3T333 25 +777TJ 727 +8K6Q6 310 +J93QA 961 +AAK59 617 +48T65 886 +49268 621 +99969 473 +AJA8A 826 +79974 566 +K358J 610 +2222Q 456 +8J488 534 +K7J4A 488 +K636K 416 +43QT6 660 +28KTQ 907 +49699 989 +27469 858 +873JT 601 +6374J 98 +JTJTT 200 +2J978 2 +474J5 353 +A557K 515 +QT3TQ 632 +7A2A2 241 +97QAQ 484 +AK4AK 825 +4A884 905 +2558K 573 +AT322 227 +48AQ7 977 +QJJTJ 630 +955J9 651 +KK55J 409 +66392 927 +4AAAQ 234 +96QA3 51 +AQTAA 964 +K34J3 605 +Q9Q9Q 284 +93999 239 +65K7T 208 +JT9A6 377 +87QJ9 245 +J269K 207 +T2JTT 269 +47274 746 +5A96A 164 +QJJ5T 716 +AAT5A 199 +694K7 710 +T8TT6 569 +J6346 181 +4Q3JA 627 +8J7J8 974 +7T25K 753 +4A26J 288 +47TT4 830 +9J99J 758 +K3K3K 195 +TT9TK 715 +QJ22T 780 +A9944 742 +22229 600 +A996A 908 +22244 818 +Q878Q 620 +QQKJQ 334 +37JJ9 490 +625Q8 356 +J6666 958 +KJ8A8 341 +363A3 333 +6A2QK 398 +44J43 215 +QKKKK 86 +K8K8J 240 +44474 109 +8AAA6 328 +AQ2Q9 641 +JJJJJ 431 +8JJ86 829 +TTT9T 161 +TT779 470 +KA748 791 +3448K 440 +44424 427 +8T57J 803 +KQK4K 418 +T738A 599 +9K5AJ 354 +38353 700 +7K77K 541 +5A248 223 +2228J 973 +222J2 244 +73J85 391 +3Q3QT 67 +JJ666 890 +9Q797 180 +2J727 734 +QKKKQ 747 +3A333 658 +J5QAT 861 +45JAT 381 +66265 224 +QQQ4Q 582 +55766 615 +A7777 866 +JQ3AQ 718 +25225 921 +A666A 115 +933KK 174 +TTTT8 609 +886J8 509 +662AJ 366 +99TT5 990 +9462A 194 +45A5A 629 +46242 583 +TQTTT 433 +23888 24 +JQ94T 100 +56693 876 +T5835 295 +2K222 933 +43Q3Q 882 +33A93 607 +8A888 650 +KKK44 26 +2AAA2 139 +328K2 499 +TKTKK 671 +JJ64J 114 +22722 612 +75T8A 160 +T44TT 448 +47434 228 +39333 225 +44QKT 47 +Q863A 581 +A9A44 345 +TJ99T 795 +822Q2 12 +4649T 967 +T4J84 938 +63636 519 +Q8K44 190 +T928T 953 +698TA 50 +TJT53 311 +KQ99J 770 +37532 797 +KAQ85 13 +K8K3J 579 +Q86JT 842 +88J78 943 +22332 774 +25Q4T 998 +999TT 44 +595J8 514 +53335 31 +927K4 423 +29J27 252 +AT33A 209 +47887 874 +466A6 243 +J4873 359 +255J2 261 +TTT5T 129 +TQTTQ 896 +Q3222 401 +434K4 126 +555A5 550 +43T79 709 +KK944 679 +42T22 430 +Q9A75 673 +Q564J 984 +Q6QQ6 552 +A777K 185 +64564 589 +T53JK 736 +7383T 27 +JA299 652 +48469 369 +42Q8Q 978 +992KK 468 +AA6A2 233 +757TJ 363 +6Q75Q 347 +25552 308 +A88JT 136 +42TJ8 21 +T472K 806 +2228T 553 +6A739 388 +QTQTJ 386 +92J99 317 +J93J9 382 +5JAJ2 707 +382A7 73 +757A7 466 +4KAT3 191 +T7J45 118 +89Q2J 869 +A23KQ 942 +2T226 480 +JJJ42 420 +J8692 481 +57555 380 +3A233 840 +TTTJ4 699 +2K666 532 +A8QT3 38 +3QJ68 216 +J8Q2K 711 +37J6K 816 +5A8T8 684 +5K5QQ 287 +43TJ4 441 +T5T5J 378 +9K9K9 33 +A3939 838 +5J5J6 538 +7KKAK 982 +86822 371 +3333Q 854 +3AAA3 489 +666T7 903 +8Q898 365 +8T789 750 +877AK 32 +4JJ44 512 +Q2JKK 280 +4484A 913 +2772Q 434 +2J543 865 +72242 125 +A2852 296 +747KJ 315 +74449 242 +J4KA2 451 +9K9J2 560 +JKKJJ 703 +KK9K9 205 +39839 968 +KQ47J 664 +66J6Q 403 +A3TTJ 533 +TQ9A5 544 +J22AA 154 +48368 789 +KA462 500 +Q66Q6 485 +J22J6 751 +677JJ 995 +2AJ2Q 459 +2K7T6 940 +A9Q48 586 +AQAAQ 542 +J333J 253 +66259 338 +8TTT8 163 +J7586 213 +JA63Q 146 +QQQ8Q 61 +52J3Q 292 +QJJQT 807 +2KJKT 374 +577J5 320 +QQQ69 704 +448K6 689 +37A3A 884 +AAJ3A 462 +23339 969 +A3A2Q 384 +5K55J 783 +8AJ5K 549 +KQQ89 408 +4444A 809 +57535 355 +46566 314 +3Q399 567 +2QQ22 934 +QT6J3 801 +QTQAA 748 +K2K7K 97 +5J665 415 +4Q55T 140 +99A29 278 +7A523 701 +7J476 714 +6824A 464 +6JT42 681 +A9746 548 +56QAT 99 +222TT 463 +K4KKK 41 +88999 899 +AA556 606 +3Q533 283 +2T233 759 +32832 344 +6KKK6 71 +AA6Q6 476 +335K3 66 +3JT66 400 +935AK 676 +7TKAQ 332 +3J34A 712 +JK757 309 +9445J 331 +8KKK8 486 +Q6J98 720 +33898 623 +668Q6 776 +J8866 536 +888K8 824 +T3TJ6 883 +2AK24 613 +QAQJ9 424 +9666J 64 +A89K5 555 +3T9T5 672 +JQQQ6 657 +9J949 851 +KKJKK 144 +2J223 321 +544QT 162 +274J9 954 +6K4K3 648 +2QQ44 889 +92J29 92 +KKK8K 945 +T4TAA 176 +67AA4 135 +69666 698 +22333 147 +85855 419 +3A783 339 +J5KK4 763 +7877A 85 +44494 737 +A646J 820 +23JK3 259 +79777 799 +J999T 442 +5T65T 235 +K99K7 111 +9K47T 405 +5Q544 647 +534J4 786 +9T7K5 594 +97AT6 432 +39J22 455 +AT4AA 396 +KAKAJ 817 +T7T7T 492 +TTQK3 644 +QKQ33 102 +AAJ9A 504 +442JK 633 +245Q6 928 +TT755 963 +JQ334 326 +4KK44 495 +AKKAA 166 +54444 524 +J9QA9 932 +5T96A 70 +5QQJQ 323 +4KK33 18 +77J7J 435 +K2K62 992 +A594J 812 +TK6TQ 563 +Q4994 880 +37737 324 +A73A7 662 +4KK4J 350 +24Q8T 722 +77877 656 +TJTKQ 461 +2J224 383 +K9K89 123 +3A254 425 +335A5 981 +A3334 625 +A46Q3 169 +JJJJ8 618 +AJTQ6 771 +742J7 238 +TTT7T 935 +J9999 116 +567Q9 307 +6992J 274 +AT285 952 +6J83J 170 +5559T 302 +K9A43 81 +9TTT9 35 +7JQJ4 598 +AQAAA 285 +AKQ7Q 802 +AA266 141 +73537 717 +75Q77 479 +8J3Q3 745 +TT7T8 68 +77JK7 148 +J2Q22 187 +A7TQJ 247 +55QJJ 155 +K7275 145 +99977 342 +JQQQQ 595 +96KTQ 501 +88J44 902 +2442Q 540 +62262 556 +A333A 171 +9T6J4 941 +7J677 860 +AAAKA 693 +47337 42 +TJT7J 217 +TK964 52 +J43T6 75 +32666 449 +973QQ 757 +AQJK7 429 +KQ4T5 634 +9J899 559 +Q6Q97 268 +5QJT5 447 +A5A22 917 +224A2 294 +65555 522 +Q3439 539 +4KKK3 394 +867A9 389 +2TQ64 572 +88J88 920 +9JKK6 458 +T2ATT 437 +66QQ7 901 +6KK3K 53 +AT3K7 10 +37T95 178 +KA978 915 +77J72 604 +Q6378 210 +5QQ7A 494 +36KAQ 592 +64774 767 +36AT5 863 +T55QT 465 +35TK3 226 +AA975 835 +TA3JJ 202 +KQQKQ 63 +K9999 808 +K2645 395 +KK977 367 +K4TKK 622 +7J39T 951 +85528 279 +TKK5K 275 +72787 761 +62662 104 +55553 665 +3J3A7 843 +TTTTA 78 +TK3JT 521 +95984 713 +33433 508 +T44T4 897 +4J7Q9 172 +96732 756 +6AKJ8 849 +24888 686 +JTA2Q 694 +32QA3 654 +5JA6J 46 +QA2AA 121 +7777J 336 +A7A7A 402 +5555T 959 +62625 40 +2Q7QQ 937 +Q3547 805 +43T73 798 +AAAA4 754 +K3598 467 +TTAAK 677 +KQ4QJ 796 +3TA2A 132 +A6A9J 919 +62644 692 +QQJAA 453 +KKK93 153 +9999Q 471 +8848Q 189 +8A9K4 790 +62A5Q 862 +75QQJ 815 +AJAAA 1 +92929 276 +TTTJT 962 +KQKJ9 417 +J2K2J 837 +6A777 571 +8A82A 668 +543T2 361 +QQ774 505 +52468 138 +AA555 286 +77699 669 +A934Q 772 +9655T 728 +2K6T5 766 +JT4J5 4 +Q97J9 743 +99559 966 +A9A9A 37 +66J73 128 +AJQAA 375 +2T222 255 +K39A6 45 +8AKQ7 564 +TK777 706 +22942 975 +22JJ2 832 +9486T 733 +5T55Q 352 +K9874 94 +2TQ2T 16 +5K588 836 +6943T 666 +936TJ 385 +22A25 9 +A5A5Q 28 +4Q4J4 859 +444K4 281 +44KQ4 316 +KJ79Q 57 +A72T4 142 +A8544 643 +844K4 179 +T9TT5 839 +44545 110 +K67A7 83 +54434 79 +97977 922 +4222K 17 +55757 137 +5AJA2 87 +2JKK2 749 +65AAJ 88 +54555 270 +79786 103 +JAA33 794 +5AK73 744 +454K8 777 +55JJ5 184 +A9884 438 +777K7 482 +488J6 91 +68965 847 +K4KK6 124 +J9QA5 322 +KA5KK 498 +8J957 872 +88899 516 +ATA88 49 +2JKKK 848 +85553 529 +332Q3 300 +3QK33 483 +23253 93 +8K333 439 +3K9AT 775 +35KJK 422 +7J77A 445 +Q6J97 841 +Q9979 251 +38849 510 +TKKKK 130 +66T96 105 +7QQQ7 376 +32AAA 318 +2867Q 54 +97QK3 11 +KK77K 916 +7358A 898 +A7A47 768 +7Q57J 346 +KJ7TA 696 +J3637 904 +K8QJ3 192 +72994 358 +QQ74Q 387 +TK6TT 493 +9932T 373 +QQ4Q4 640 +J4258 729 +AQ444 289 +899JJ 697 +AAJ37 831 +38QT9 924 +9666A 513 +59Q2A 856 +Q7QTJ 393 +Q2Q9Q 721 +88383 193 +88882 256 +36T35 222 +AQ8Q9 3 +J999K 229 +JQT3A 29 +TT888 642 +78694 236 +939QA 675 +88A6K 290 +56J55 122 +33Q36 82 +27275 769 +62Q66 537 +KKKJ4 723 +99JJA 965 +62J42 478 +897KJ 645 +ATTT6 554 +2Q458 597 +99968 460 +44Q8Q 502 +8KKK5 43 +9K5K9 254 +45A44 496 +A4744 19 +5QQ3Q 900 +K3QKQ 793 +55665 305 +JQKTJ 475 +22K82 390 +A2299 804 +JTQKK 188 +J9494 80 +2JJTT 167 +2J229 410 +9966A 106 +4J88T 814 +5K8T6 813 +TAA6T 782 +TJ854 956 +66662 784 +TT889 577 +A3A24 443 +K27K2 55 +6Q368 397 +K5563 732 +8AAAA 870 +22226 892 +J333T 881 +44AJ4 372 +67K35 578 +843K2 319 +47K24 755 +9T76K 895 +AA993 873 +85888 72 +JKKQ3 670 +66667 90 +J59AJ 988 +TKJ62 738 +4446Q 95 +JT6KQ 864 +73254 764 +QAQAQ 949 +Q62JQ 779 +43K33 687 +8939Q 557 +8A784 34 +27727 528 +32TK3 637 +J3332 196 +Q5J2A 918 +JT6T7 411 +98888 511 +AAA2A 299 +4444J 112 +222KK 972 +93K48 173 +99499 277 +4K8QA 947 +J6TK3 518 +3KJA9 212 +JT5K6 291 +92KTQ 593 +84727 370 +66KKJ 231 +6J6A9 877 +475JA 739 +JK9KK 39 +2TQ3J 912 +TQ946 204 +2T9Q4 785 +333A8 8 +J7347 999 +4K28A 360 +85668 994 +ATAAA 211 +7JK99 250 +6A74K 788 +8A7QA 7 +4464T 392 +Q84T3 760 +39JQ3 413 +5776T 939 +77A7A 117 +25Q55 576 +6T372 450 +57595 925 +3333J 575 +48282 979 +JQ9J3 506 +62T66 312 +A888J 639 +45J36 263 +J8KKQ 525 +QQ42T 719 +64944 930 +Q54AJ 120 +A94QA 957 +QQ777 894 +2TT6K 348 +KJ264 379 +4666J 655 +64464 987 +447Q3 653 +A37K7 810 +J32AA 614 +ATTJT 399 +26263 62 +JQ423 765 +T8T8J 800 +T6AKA 15 +4QQQ3 596 +KQ7T6 724 +TT55T 708 +94Q72 183 +78TJJ 526 +T8KKK 970 +K888K 303 +6J5J8 201 +55255 156 +QQJ96 821 +3886J 891 +72722 56 +7KKKK 220 +6T6AQ 77 +52655 638 +68832 368 +86356 271 +K2879 976 +3859T 608 +QQ3Q3 108 +424A7 5 +A7TA5 631 +T535T 680 +53333 551 +5TT29 14 +J5274 580 +K7A9A 659 +T6T46 725 +7J87K 871 +45QAT 997 +67677 910 +47549 649 +TQKJ2 926 +99259 76 +J43J3 337 +KT3KK 219 +Q6K22 705 +6246A 426 +3J77Q 588 +59KK6 740 +T77JT 568 +33QQ3 667 +5J4JQ 931 +8T3TQ 946 +K4KA4 741 +KT4A6 143 +3TTQ3 887 +3KQ85 58 +QQKQ7 950 +KJ77K 351 +QQKQQ 457 +JKTTK 134 +66664 407 +28462 327 +K6774 258 +KKK9K 661 +T66T3 823 +44QQ4 330 +66AAJ 313 +QQTQT 175 +7774J 414 +K8858 527 +QA2T4 65 +35735 298 +Q928K 545 +3J662 570 +37438 349 +T64AJ 406 +8A2AQ 678 +8AKKJ 885 +TQ4A6 412 +5KQ5K 452 +AA3AT 36 +TT5TJ 131 +Q47K3 301 +99992 561 +6KQT8 249 +77557 198 +4TTAT 101 +43J47 257 +J6844 30 +4K454 531 +TTA5T 674 +Q9Q99 602 +QA694 267 +J6QT6 273 +65588 469 +4TTTT 84 +J35J7 603 +622J2 230 +34542 520 +TT2T2 168 +7K798 517 +63863 792 +TJ8TT 472 +38393 133 +JJQKK 691 +AAAJJ 852 +J655K 735 +KQ6JJ 182 +6QQQQ 929 +47T53 297 +JK665 911 +44433 454 +A6364 726 +J4K93 446 +548J8 60 +T52J8 611 +59885 340 +A8K8A 991 +A88A8 845 +66K56 218 +86626 834 +AAA59 624 +52422 325 +J3363 906 +JJKKK 262 +5JJ69 357 +879A4 543 +66T66 343 +9K574 96 +9AAAA 731 +77477 893 +AAA56 6 +555J5 306 +4K882 503 +TAK97 828 +22246 590 +A8AA9 497 +76779 888 +2AAJ4 150 +88848 151 +K73J8 436 +9393J 547 +6Q666 221 +55K7K 364 +KK2TT 335 +A222A 855 +93QQ9 265 +94443 833 +3AJ26 523 +2J233 663 +2347T 22 +49J6K 165 +33J98 762 +3Q594 304 +A2T3K 530 +2K53T 535 +8JK78 923 +2658J 846 +6766J 159 +J9988 635 +J8J88 20 +JA476 985 +J5355 781 +33365 404 +KKAKJ 773 +935TJ 980 +TJ522 186 +Q8QTQ 591 +3J238 587 +354QT 983 +67JQ8 993 +K6KK8 914 +3TTT3 362 +J8KAT 585 +QQQ9T 59 +A8JA8 23 +38742 237 +QQQ3Q 558 +6J68A 811 +5433A 119 +8T8KJ 971 +94AJA 944 +783T7 844 +22JK2 857 +8KA5A 197 +J4JJ4 203 +77773 682 +5J455 909 +K4Q4Q 266 +99787 827 +5727J 487 +T92Q6 822 diff --git a/data/08/example.txt b/data/08/example.txt new file mode 100644 index 0000000..9029a1b --- /dev/null +++ b/data/08/example.txt @@ -0,0 +1,9 @@ +RL + +AAA = (BBB, CCC) +BBB = (DDD, EEE) +CCC = (ZZZ, GGG) +DDD = (DDD, DDD) +EEE = (EEE, EEE) +GGG = (GGG, GGG) +ZZZ = (ZZZ, ZZZ) diff --git a/data/08/example2.txt b/data/08/example2.txt new file mode 100644 index 0000000..7d1b58d --- /dev/null +++ b/data/08/example2.txt @@ -0,0 +1,5 @@ +LLR + +AAA = (BBB, BBB) +BBB = (AAA, ZZZ) +ZZZ = (ZZZ, ZZZ) diff --git a/data/08/input.txt b/data/08/input.txt new file mode 100644 index 0000000..1d47807 --- /dev/null +++ b/data/08/input.txt @@ -0,0 +1,744 @@ +LLLRRLRRRLLRRLRRLLRLRRLRRRLRRLRRLRRRLRLRRLRLRRLRRLLRRLRLLRRLLLRRRLRRLRLRLRRRLRLLRRLRRRLRRLRRLRRLRLLRLLRRLRRRLRRLRLRRLRRRLRRLLRLLRRLRRRLLRRRLRLRRRLLRLRRLRRLLRRLRRLLLRRRLRLRRRLRRLLRLRRLRLLRRRLRLRLLRLRRRLRLRRRLRRLRLRLLRLRRRLRRLRRRLRRRLRLRRRLRRRLLLLRLRLRRRLLLRLRRRLRRLRLRRLLRLLRRRR + +FSH = (CGN, NDK) +LQT = (NSK, XBG) +LCP = (QQB, NTB) +DFG = (KTV, NJR) +MCC = (TRF, NHH) +PHG = (VMX, SHB) +SMP = (MKD, TBS) +MRT = (NJX, HHJ) +LNG = (KRF, VDK) +TKG = (VLM, XFQ) +QCR = (BDL, VKQ) +PQC = (CXK, HKS) +DQR = (LRS, CCF) +XVP = (MSP, DVD) +JGN = (DJF, QCP) +QCP = (MLF, CPS) +CNJ = (NLQ, BJD) +DPR = (CVL, NSB) +VKQ = (PGL, LRK) +XGF = (DBG, NSG) +TXH = (JQJ, XHN) +PHR = (SRD, HVS) +FXF = (KGG, QCV) +DXK = (RQB, GTX) +PKC = (KQP, SMT) +SHX = (VDF, RFP) +JSQ = (BHM, TCJ) +LQS = (GDD, FJT) +XVJ = (DTL, BKR) +TJF = (XKG, BTD) +KMP = (TQL, CFV) +VBV = (BJL, DHL) +JXR = (PKD, BKV) +TBN = (TGK, BLP) +PQD = (MCC, QDF) +KRF = (VSB, JXQ) +RNJ = (JGN, NJH) +HVR = (JXK, SMH) +DML = (MHP, SBL) +HJH = (KGR, TXH) +JCF = (GBJ, GBJ) +SKX = (VVX, SNX) +SPS = (VCS, RKK) +MJD = (SSL, VKM) +TMG = (CNN, XTJ) +BBM = (QGJ, LJL) +MFV = (XPC, BCC) +SCD = (QLG, BCB) +QGQ = (MPV, SMP) +DQS = (QSN, NSV) +GTN = (BGF, NBD) +JDG = (GRX, CLV) +PMM = (HGP, SBS) +GHV = (CNC, NJQ) +RBG = (CGN, NDK) +MXL = (XXQ, KQD) +KQQ = (CBL, LXX) +BVT = (CFS, TPH) +DFD = (FKV, MVK) +CJV = (GTN, JNH) +PGF = (XNS, CNJ) +JTF = (BQS, HMG) +XXB = (NXF, NVF) +GDD = (HQB, DPR) +KTT = (TGT, XGF) +DCR = (LNG, HLF) +FVQ = (JQT, DFN) +DTX = (RDB, CHV) +PPB = (PQC, XVR) +NJK = (DXK, HTV) +DQN = (LNL, GBK) +GCP = (RTJ, XQL) +DHR = (KCS, KVP) +HNQ = (GPC, MNL) +RDV = (FQN, GNB) +NSG = (FLM, PCD) +LJL = (XVP, LHX) +HVD = (CML, CPT) +HGN = (LRS, CCF) +GGS = (FCS, VKS) +PHV = (SJF, SJF) +NLH = (BJJ, XKX) +XXQ = (VTP, XDK) +KHL = (BJL, DHL) +DKG = (CLV, GRX) +HQX = (KGH, BXP) +RGC = (PTM, QPV) +LVJ = (TVV, TVV) +PNG = (XCR, NTV) +XCM = (FQN, GNB) +QRV = (XMS, XTG) +DJF = (MLF, CPS) +XJG = (MQS, QHX) +BRD = (KCS, KVP) +DDM = (DMF, KBX) +GKP = (JMV, TBN) +MTV = (GTN, JNH) +KGM = (GRF, VTM) +SNX = (PRG, CGT) +DXT = (GRF, VTM) +SXT = (FKX, MNM) +XPL = (TPH, CFS) +NJH = (QCP, DJF) +MJX = (TDB, SHX) +JJR = (DTL, BKR) +SLB = (NXM, XLT) +NSV = (QBD, MHT) +XXH = (BSF, KLF) +FMG = (XCM, RDV) +RKK = (RNR, BVR) +VQJ = (TBR, NQG) +QRR = (VPP, TDH) +GLF = (PPD, VRF) +PKT = (PHT, TPR) +KVP = (LFH, LTQ) +DSQ = (VTJ, FBN) +LXL = (GXR, KTT) +AAA = (LBL, QGQ) +QQT = (PXM, DBS) +PRG = (FMN, XXD) +NXF = (KQN, HHK) +XPC = (GKP, XSB) +SKP = (MLR, GGS) +BMD = (QSN, NSV) +VKL = (BCC, XPC) +FCC = (QCR, DSS) +XSB = (TBN, JMV) +MTD = (JTF, SHN) +TJX = (TGM, HJH) +HTV = (RQB, GTX) +HCB = (BSF, KLF) +FXK = (PHV, TCN) +XDK = (DFG, SXH) +SSL = (XTV, CXM) +PPH = (XXQ, KQD) +MGC = (NHB, FTM) +CPS = (MML, JHQ) +KKJ = (DQR, HGN) +RKH = (LKL, FKD) +MCG = (JQQ, CLG) +RLD = (PQD, CNV) +PCV = (QVL, DNF) +LQV = (THB, LXV) +DQH = (FSN, GHZ) +MPV = (MKD, TBS) +HGB = (LXV, THB) +DBG = (FLM, PCD) +GSC = (FSR, TRM) +NCF = (LXL, MVN) +XBJ = (CHQ, MXM) +TNN = (NQG, TBR) +PVF = (XVS, XDM) +QCL = (QRS, LQC) +PGL = (JCK, DKH) +XQN = (LNG, HLF) +RQB = (SNR, LPL) +DFM = (GLV, NHG) +BNN = (MMX, DPK) +VSF = (HVR, FVG) +PFJ = (TNK, NVJ) +BKX = (RKK, VCS) +QBL = (PKT, RBJ) +HBC = (FSR, TRM) +DVM = (QVL, DNF) +DPK = (VBG, RKF) +SMH = (TTV, VCK) +GBK = (PXL, DHH) +XDJ = (MFV, VKL) +VMN = (VGJ, NQT) +HHJ = (PVL, RHR) +FND = (XHS, VHF) +DLV = (VSF, DFV) +NBK = (GMR, NXJ) +CSX = (JCX, VMG) +FDB = (VHK, SCB) +VKM = (CXM, XTV) +SXH = (NJR, KTV) +HXZ = (FJR, SKP) +JXN = (MDL, FCC) +KLS = (FXF, LPQ) +NVF = (KQN, HHK) +QXP = (KLS, KFS) +XMX = (KKJ, CLH) +KXV = (MHP, SBL) +TBR = (NVS, PGF) +MXN = (VBP, RMJ) +RCX = (KGM, DXT) +BJD = (KRB, HNQ) +KVJ = (HVD, QXX) +BQS = (HCK, THS) +KGR = (XHN, JQJ) +GDV = (TRP, MXF) +TPR = (XVL, SKX) +KJC = (TRB, VRJ) +CNV = (MCC, QDF) +QPG = (BSR, GGL) +SHQ = (VLM, XFQ) +VTM = (JKN, GJJ) +MPB = (NTV, XCR) +JQQ = (DPX, GHJ) +PVL = (DKQ, FJN) +PCD = (KMF, FTP) +PPK = (PVF, XLN) +GRX = (GVD, HQP) +GQP = (VGJ, NQT) +VMG = (LPF, RNJ) +GHZ = (FTX, DQN) +VSB = (PBP, LKF) +VLM = (GMX, LVP) +VHG = (FCC, MDL) +SBS = (RSF, FHP) +QFJ = (VDC, NCF) +CKR = (FJT, GDD) +CBK = (TMK, GJB) +BBN = (MJL, BBR) +XCX = (MLN, QRR) +GXR = (TGT, XGF) +HLF = (VDK, KRF) +RDP = (CJN, BBN) +QJL = (PNT, CRC) +SHN = (BQS, HMG) +DMD = (DLV, KVB) +XRL = (LVF, XFL) +HCK = (RKJ, FNJ) +PXM = (XVM, LTM) +GQT = (JKK, SLQ) +TPZ = (HGB, LQV) +GBJ = (LQV, HGB) +CFV = (STD, CSK) +FTP = (TKG, SHQ) +TVJ = (HVS, SRD) +CQC = (NCK, LMV) +FQN = (FSH, RBG) +FRQ = (KLQ, QRV) +XLN = (XDM, XVS) +VHX = (PLN, TXM) +DTV = (PKD, BKV) +NBD = (TLB, FRQ) +NSJ = (CFH, PXP) +FCS = (GHV, JBR) +BML = (TCJ, BHM) +PTM = (XGG, FDS) +XQL = (QNH, THK) +QDF = (TRF, NHH) +MHT = (QRN, BNN) +LJB = (FQC, GNQ) +QFK = (LPR, QJL) +NHK = (XLT, NXM) +TXM = (MFR, GDV) +TMK = (NMD, RQF) +GKF = (JXR, DTV) +LXX = (LVJ, SQH) +XVR = (CXK, HKS) +XCG = (QJL, LPR) +NJR = (TDL, GSK) +VTP = (DFG, SXH) +DBS = (XVM, LTM) +VMX = (SSM, PLS) +SCB = (BPH, MFF) +MLN = (TDH, VPP) +QXM = (VRF, PPD) +LKL = (NDX, DKT) +CPF = (FTM, NHB) +JLG = (FKN, GCP) +RDK = (QRR, MLN) +VCS = (BVR, RNR) +XKX = (TMJ, DQD) +THS = (RKJ, FNJ) +QQB = (SKR, VGH) +NQG = (NVS, PGF) +NTB = (VGH, SKR) +MXF = (HMC, NJK) +LXT = (CNV, PQD) +LTM = (QDL, KMP) +LNJ = (STT, FXL) +HKL = (CBL, CBL) +QGD = (KXJ, FXK) +JCX = (LPF, RNJ) +TRB = (TNN, VQJ) +QBD = (QRN, BNN) +JQJ = (DXL, MJX) +CLH = (DQR, HGN) +MXM = (RKH, LKT) +PTP = (XCG, QFK) +LVP = (GJX, NRP) +DKQ = (NTL, NNR) +FBS = (HGP, SBS) +BPH = (PMX, RDP) +FJR = (GGS, MLR) +GSX = (XBJ, TMB) +KTV = (TDL, GSK) +CHQ = (RKH, LKT) +TGK = (KVD, NNS) +LKT = (LKL, FKD) +RFP = (NSS, JFK) +FJC = (GQV, GKG) +RSF = (GSX, LFN) +FQZ = (SGP, NBK) +NJA = (SKP, FJR) +TRM = (MHK, DPH) +QNH = (PPK, FTL) +QNP = (FVQ, SRQ) +XLT = (TRN, QFJ) +VRJ = (TNN, VQJ) +GQV = (KRJ, RCX) +SKG = (FKP, KPD) +GLV = (VCJ, SJM) +GJX = (JLG, FSV) +FMN = (CRX, JLS) +DHJ = (KRM, NCN) +QDL = (CFV, TQL) +NBQ = (JHP, XXB) +GLC = (VJK, NBN) +DHH = (SVN, KVJ) +CRX = (CRJ, CRJ) +DQD = (KFP, VQM) +SKR = (CHN, GQL) +NBN = (JLJ, JQF) +HNR = (NJX, HHJ) +XTG = (VHG, JXN) +XXD = (CRX, JLS) +TQL = (CSK, STD) +SQH = (TVV, FQZ) +TMB = (MXM, CHQ) +CCF = (RVJ, PQR) +XTJ = (KQS, LJB) +DNF = (QTK, JLV) +XTV = (PHR, TVJ) +JXQ = (LKF, PBP) +FBN = (LXR, PPB) +LNS = (TGM, HJH) +LPC = (FND, KKG) +NDK = (CSV, HVK) +KRJ = (DXT, KGM) +FKP = (XGN, SCD) +FDS = (PNG, MPB) +NQB = (LPP, BNJ) +GNQ = (MCG, LKM) +LHX = (DVD, MSP) +FTM = (GLF, QXM) +RDB = (QRF, CBK) +CNN = (KQS, LJB) +FNC = (GKH, ZZZ) +RBJ = (TPR, PHT) +KBX = (DKF, HXZ) +NCK = (PPH, MXL) +DSS = (VKQ, BDL) +HVS = (CLP, QJR) +LNL = (DHH, PXL) +NDX = (NBQ, QTR) +MLR = (FCS, VKS) +PMX = (CJN, BBN) +HHK = (GKF, DSV) +SVN = (QXX, HVD) +TGT = (DBG, NSG) +XKG = (XRL, CPX) +QCV = (PFJ, NPS) +TRP = (HMC, NJK) +SQG = (GGL, BSR) +FTX = (LNL, GBK) +CJN = (BBR, MJL) +VRF = (XDJ, CXV) +VTJ = (PPB, LXR) +XTS = (NXG, CQC) +BHR = (HKL, KQQ) +HMK = (SLQ, JKK) +NHG = (SJM, VCJ) +QNR = (HNR, MRT) +KPD = (XGN, SCD) +BTD = (XRL, CPX) +NJX = (PVL, RHR) +FSV = (GCP, FKN) +MKL = (FBN, VTJ) +TRN = (NCF, VDC) +NMD = (XSS, XTF) +FSN = (DQN, FTX) +TTV = (RLD, LXT) +JCK = (BQB, DMD) +BXG = (SSL, VKM) +FGC = (BQN, GXF) +VCJ = (XPL, BVT) +QGJ = (XVP, LHX) +VHK = (BPH, MFF) +CGN = (CSV, HVK) +SKJ = (QPV, PTM) +CFS = (TJF, DVX) +JJP = (KFS, KLS) +XMS = (JXN, VHG) +QRF = (GJB, TMK) +THK = (PPK, FTL) +RKJ = (SRC, VJM) +KQD = (XDK, VTP) +CLG = (DPX, GHJ) +KVD = (HCB, XXH) +XCR = (QCL, KDK) +BSR = (BXG, MJD) +GDS = (KGH, BXP) +GMR = (FFF, JTK) +VVX = (PRG, CGT) +PCJ = (PCV, DVM) +TCJ = (KCD, LPC) +PKD = (CJV, MTV) +DPH = (BDJ, RXP) +CGT = (FMN, XXD) +TTL = (FKX, MNM) +CBL = (LVJ, LVJ) +LFN = (XBJ, TMB) +NHB = (GLF, QXM) +FNJ = (SRC, VJM) +FLM = (KMF, FTP) +FTL = (XLN, PVF) +TPH = (TJF, DVX) +BSF = (NSJ, JLP) +JBR = (CNC, NJQ) +PXP = (SGJ, SXG) +LRS = (RVJ, PQR) +XVL = (SNX, VVX) +SBL = (FNB, NLH) +HXH = (FKP, KPD) +JFK = (QVX, DHJ) +GKG = (RCX, KRJ) +DHL = (JDG, DKG) +NSB = (FJC, DXN) +SJF = (JCF, JCF) +STD = (VBV, KHL) +NSS = (DHJ, QVX) +GPC = (JDH, JDH) +RPS = (JCF, GQS) +MMM = (SKJ, RGC) +XFQ = (GMX, LVP) +KXJ = (PHV, TCN) +JLS = (CRJ, SLM) +QLB = (DMF, DMF) +NNR = (KJC, NGJ) +KRM = (DML, KXV) +DKH = (BQB, DMD) +CHV = (QRF, CBK) +PHT = (XVL, SKX) +MVN = (KTT, GXR) +SFB = (DLD, FMG) +FNM = (MRT, HNR) +HMG = (THS, HCK) +XNS = (NLQ, BJD) +CLV = (HQP, GVD) +MMX = (RKF, VBG) +BVR = (SLB, NHK) +LRP = (GXF, BQN) +GNB = (FSH, RBG) +JQF = (CLD, QQT) +HMC = (HTV, DXK) +TRF = (LNS, TJX) +HQB = (NSB, CVL) +TVV = (NBK, SGP) +GHJ = (JJR, XVJ) +KCS = (LFH, LTQ) +LPR = (CRC, PNT) +JXK = (TTV, VCK) +KFS = (LPQ, FXF) +TXR = (DTX, GCR) +BQN = (QBL, DPD) +VNL = (DTX, GCR) +CXV = (MFV, VKL) +GKN = (FNM, QNR) +BTJ = (LPP, BNJ) +PBP = (SFB, HSG) +CVL = (FJC, DXN) +RXP = (DHV, PVZ) +XVM = (QDL, KMP) +XVS = (CMF, PKH) +BQB = (DLV, KVB) +QLG = (LTD, XJG) +HVK = (KSF, CVV) +DTL = (HBC, GSC) +BHA = (DQN, FTX) +MHP = (NLH, FNB) +VDK = (JXQ, VSB) +VBG = (MGC, CPF) +GVD = (VHX, TKT) +RKF = (MGC, CPF) +NHH = (LNS, TJX) +BKV = (CJV, MTV) +BBR = (BKX, SPS) +HJR = (NQB, BTJ) +CMF = (VRM, BHR) +TCN = (SJF, RPS) +JHP = (NVF, NXF) +KGH = (DSQ, MKL) +PKH = (VRM, BHR) +NVJ = (VNL, TXR) +LPL = (XCX, RDK) +MLF = (MML, JHQ) +JLP = (CFH, PXP) +NPS = (TNK, NVJ) +GJB = (NMD, RQF) +VRM = (HKL, KQQ) +BSV = (HMK, GQT) +RTJ = (QNH, THK) +KSF = (GKN, RRD) +VGH = (GQL, CHN) +MNM = (HVP, MXN) +GQL = (BMD, DQS) +JCM = (JGT, QGD) +DXN = (GKG, GQV) +GVV = (BTJ, NQB) +SHB = (SSM, PLS) +NXG = (NCK, LMV) +KQP = (FGC, LRP) +KDK = (QRS, LQC) +SNR = (XCX, RDK) +MHK = (BDJ, BDJ) +KQS = (FQC, GNQ) +SSM = (TFK, BKJ) +VDC = (MVN, LXL) +CML = (XMX, CXL) +HSG = (DLD, FMG) +MDL = (QCR, DSS) +CRC = (FBS, PMM) +GRF = (JKN, GJJ) +HKS = (JJP, QXP) +JGK = (QFK, XCG) +GQS = (GBJ, TPZ) +GPV = (XTJ, CNN) +VBP = (HPX, MMM) +CXL = (KKJ, CLH) +RVL = (DJC, LQT) +GJJ = (DXV, NTQ) +TGM = (KGR, TXH) +SGJ = (LDX, XTS) +CLP = (XBQ, MTD) +HGP = (FHP, RSF) +GMX = (NRP, GJX) +XBQ = (JTF, SHN) +NLQ = (KRB, HNQ) +HPX = (SKJ, RGC) +KFP = (QNP, LMT) +JHQ = (VMN, GQP) +LBL = (MPV, SMP) +DKF = (SKP, FJR) +CXM = (PHR, TVJ) +RMJ = (MMM, HPX) +XPK = (PFS, JCM) +DGM = (JCX, VMG) +BDJ = (DHV, DHV) +TDH = (BBM, XMT) +LTD = (QHX, MQS) +MNL = (JDH, DQH) +XTF = (PJD, LNJ) +FQC = (MCG, LKM) +QPV = (FDS, XGG) +LPQ = (QCV, KGG) +DXL = (TDB, SHX) +JNK = (SHB, VMX) +NNS = (XXH, HCB) +BCB = (XJG, LTD) +CPT = (CXL, XMX) +BKJ = (QLB, DDM) +PPD = (CXV, XDJ) +FKN = (RTJ, XQL) +MML = (VMN, GQP) +BJJ = (DQD, TMJ) +QSN = (MHT, QBD) +TKT = (TXM, PLN) +NTQ = (HJR, GVV) +MVK = (RVL, MNN) +NJQ = (LCP, CQK) +HTA = (NBK, SGP) +GCR = (RDB, CHV) +FHP = (LFN, GSX) +CFH = (SGJ, SXG) +VCK = (RLD, LXT) +FXL = (FDB, XFB) +KRB = (GPC, GPC) +JMV = (BLP, TGK) +LVF = (TRR, PCJ) +QRN = (DPK, MMX) +BNJ = (GLC, RSL) +XFL = (PCJ, TRR) +PCC = (GLV, NHG) +FJT = (HQB, DPR) +XPQ = (FKV, MVK) +KLQ = (XTG, XMS) +KGG = (PFJ, NPS) +TRR = (DVM, PCV) +QTR = (JHP, XXB) +DLD = (RDV, XCM) +FJS = (PFS, JCM) +SRC = (JSQ, BML) +LFH = (PCC, DFM) +XHS = (TMG, GPV) +JLV = (SQG, QPG) +DJC = (NSK, XBG) +JDH = (FSN, FSN) +SJM = (XPL, BVT) +JQT = (XPK, FJS) +SRD = (CLP, QJR) +PLN = (GDV, MFR) +MFR = (MXF, TRP) +NRP = (JLG, FSV) +XMT = (QGJ, LJL) +FVR = (XQN, DCR) +BDL = (PGL, LRK) +MSP = (PMS, JMM) +QVX = (KRM, NCN) +KVB = (DFV, VSF) +MNN = (LQT, DJC) +TNK = (TXR, VNL) +DVX = (BTD, XKG) +DFV = (HVR, FVG) +NCN = (DML, KXV) +PFS = (QGD, JGT) +LXV = (JGK, PTP) +FNB = (XKX, BJJ) +CSV = (CVV, KSF) +NSK = (GFC, BSV) +DMF = (DKF, DKF) +VJM = (BML, JSQ) +SMT = (FGC, LRP) +LKF = (SFB, HSG) +VPL = (GKH, GKH) +LPF = (NJH, JGN) +RNR = (NHK, SLB) +PQR = (QXC, FVR) +LDX = (NXG, CQC) +LPP = (GLC, RSL) +PLS = (TFK, BKJ) +BGF = (TLB, FRQ) +VGJ = (LQS, CKR) +NXM = (TRN, QFJ) +LMT = (FVQ, SRQ) +XBG = (GFC, BSV) +RVJ = (QXC, FVR) +LTQ = (PCC, DFM) +HQP = (TKT, VHX) +MJL = (BKX, SPS) +LQC = (SKG, HXH) +FVG = (JXK, SMH) +KKG = (XHS, VHF) +XGN = (QLG, BCB) +RRD = (FNM, QNR) +KLF = (NSJ, JLP) +PNT = (FBS, PMM) +CSK = (VBV, KHL) +GXF = (QBL, DPD) +FKD = (DKT, NDX) +MFF = (PMX, RDP) +VHF = (GPV, TMG) +TMJ = (KFP, VQM) +KCD = (KKG, FND) +CQK = (QQB, NTB) +NQT = (LQS, CKR) +FSR = (MHK, MHK) +CLD = (PXM, DBS) +NGJ = (VRJ, TRB) +QXC = (DCR, XQN) +RHR = (FJN, DKQ) +NVS = (CNJ, XNS) +VJK = (JQF, JLJ) +LKM = (CLG, JQQ) +BLP = (NNS, KVD) +FFF = (HQX, GDS) +XFB = (SCB, VHK) +XGG = (MPB, PNG) +SLQ = (CFJ, PKC) +SXG = (XTS, LDX) +CNC = (LCP, CQK) +PVZ = (TTL, SXT) +GGL = (MJD, BXG) +DPD = (RBJ, PKT) +SLM = (VPL, FNC) +NTV = (QCL, KDK) +DVD = (PMS, JMM) +QVL = (QTK, JLV) +THB = (PTP, JGK) +NTL = (KJC, NGJ) +VKS = (GHV, JBR) +QRS = (HXH, SKG) +JKN = (DXV, NTQ) +BHM = (KCD, LPC) +CHN = (DQS, BMD) +PXL = (SVN, KVJ) +CPX = (LVF, XFL) +LXR = (PQC, XVR) +FKX = (MXN, HVP) +DSV = (DTV, JXR) +CVV = (RRD, GKN) +JMM = (XPQ, DFD) +RSL = (NBN, VJK) +LJA = (LQV, HGB) +KMF = (SHQ, TKG) +JNH = (BGF, NBD) +XSS = (LNJ, PJD) +BCC = (GKP, XSB) +JTK = (GDS, HQX) +RQF = (XTF, XSS) +BXP = (MKL, DSQ) +ZZZ = (QGQ, LBL) +TFK = (QLB, QLB) +GKH = (LBL, QGQ) +JLJ = (QQT, CLD) +CRJ = (VPL, VPL) +TDL = (PHG, JNK) +QXX = (CPT, CML) +DKT = (QTR, NBQ) +FKV = (RVL, MNN) +GFC = (HMK, GQT) +LRK = (DKH, JCK) +QJR = (XBQ, MTD) +CFJ = (SMT, KQP) +TLB = (QRV, KLQ) +BJL = (JDG, DKG) +GTX = (SNR, LPL) +TBS = (CSX, DGM) +JGT = (KXJ, FXK) +MQS = (BRD, DHR) +CXK = (JJP, QXP) +PMS = (DFD, XPQ) +FJN = (NNR, NTL) +SRQ = (JQT, DFN) +KQN = (DSV, GKF) +GSK = (PHG, JNK) +PJD = (STT, FXL) +MKD = (DGM, CSX) +SGP = (GMR, NXJ) +DFN = (XPK, FJS) +STT = (XFB, FDB) +XXA = (SXT, TTL) +VDF = (JFK, NSS) +BKR = (HBC, GSC) +JKK = (CFJ, PKC) +TDB = (VDF, RFP) +QTK = (QPG, SQG) +LMV = (PPH, MXL) +XHN = (MJX, DXL) +QHX = (DHR, BRD) +VQM = (LMT, QNP) +XDM = (PKH, CMF) +VPP = (BBM, XMT) +DXV = (HJR, GVV) +HVP = (RMJ, VBP) +DPX = (JJR, XVJ) +DHV = (SXT, TTL) +NXJ = (JTK, FFF) diff --git a/day01.lisp b/day01.lisp new file mode 100644 index 0000000..088c0d7 --- /dev/null +++ b/day01.lisp @@ -0,0 +1,63 @@ +(defun input-lines (f) + (with-open-file (s f) + (loop for line = (read-line s nil 'eof) + until (eq line 'eof) + collect line))) + +(defun collect-line-digits (line) + (loop for char across line + if (digit-char-p char) + collect (digit-char-p char))) + +(defun calibration-value (numbers) + (let ((fst (first numbers)) + (lst (car (last numbers)))) + (+ (* 10 fst) lst))) + +(defun calibration-values (lnumbers) + (mapcar #'calibration-value lnumbers)) + +(defun solve1 (f) + (let ((lnumbers (mapcar #'collect-line-digits (input-lines f)))) + (reduce #'+ (calibration-values lnumbers)))) + +(defun string-compare (s1 s2 begin) + (let ((l1 (array-total-size s1)) + (l2 (- (array-total-size s2) begin))) + (if (>= l2 l1) + (equalp s1 (subseq s2 begin (+ begin l1)))))) + +(defun string-digit-text-p (s begin) + (cond ((string-compare "zero" s begin) 0) + ((string-compare "one" s begin) 1) + ((string-compare "two" s begin) 2) + ((string-compare "three" s begin) 3) + ((string-compare "four" s begin) 4) + ((string-compare "five" s begin) 5) + ((string-compare "six" s begin) 6) + ((string-compare "seven" s begin) 7) + ((string-compare "eight" s begin) 8) + ((string-compare "nine" s begin) 9))) + +(defun string-digit-p (s begin) + (let ((digit (digit-char-p (aref s begin)))) + (if digit + digit + (string-digit-text-p s begin)))) + +(defun collect-line-digits2 (line) + (loop with l = (array-total-size line) + for i from 0 to (- l 1) + as d = (string-digit-p line i) + when d + collect d)) + +(defun solve2 (f) + (let ((lnumbers (mapcar #'collect-line-digits2 (input-lines f)))) + (reduce #'+ (calibration-values lnumbers)))) + +(print (solve1 "data/01/example1.txt")) +(print (solve1 "data/01/input.txt")) +(print (solve2 "data/01/example2.txt")) +(print (solve2 "data/01/input.txt")) + diff --git a/day02.lisp b/day02.lisp new file mode 100644 index 0000000..c007a9f --- /dev/null +++ b/day02.lisp @@ -0,0 +1,58 @@ +(defun input-lines (f) + (with-open-file (s f) + (loop for line = (read-line s nil 'eof) + until (eq line 'eof) + collect line))) + +(defun check-set (string red green blue) + (multiple-value-bind (n begin) + (parse-integer string :junk-allowed t) + (cond ((search "red" string :start2 begin) (<= n red)) + ((search "green" string :start2 begin) (<= n green)) + ((search "blue" string :start2 begin) (<= n blue))))) + +(defun split-by-char (char string) + (loop for i = 0 then (1+ j) + as j = (position char string :start i) + collect (subseq string i j) + while j)) + +(defun check-round (string red green blue) + (let ((sets (split-by-char #\, string))) + (not (find-if-not (lambda (set) (check-set set red green blue)) sets)))) + +(defun check-game (string red green blue) + (let ((pstring (nth 1 (split-by-char #\: string)))) + (let ((rounds (split-by-char #\; pstring))) + (not (find-if-not (lambda (set) (check-round set red green blue)) rounds))))) + +(defun solve1 (f) + (loop for line in (input-lines f) + as gid = (parse-integer line :junk-allowed t :start 5) + when (check-game line 12 13 14) + sum gid)) + +(defun cube-count (string color) + (multiple-value-bind (n begin) + (parse-integer string :junk-allowed t) + (if (search color string :start2 begin) n 0))) + +(defun game-max-cubes (line color) + (loop for i = (1+ (position #\: line)) then (1+ j) + as j = (position-if (lambda (c) (or (equal c #\,) (equal c #\;))) line :start i) + as count = (cube-count (subseq line i j) color) + maximize count + while j)) + +(defun solve2 (f) + (loop for line in (input-lines f) + as r = (game-max-cubes line "red") + as g = (game-max-cubes line "green") + as b = (game-max-cubes line "blue") + sum (* r g b))) + +(print (solve1 "data/02/example.txt")) +(print (solve1 "data/02/input.txt")) +(print (solve2 "data/02/example.txt")) +(print (solve2 "data/02/input.txt")) + diff --git a/day03.lisp b/day03.lisp new file mode 100644 index 0000000..aedf078 --- /dev/null +++ b/day03.lisp @@ -0,0 +1,119 @@ +(defun input-lines (f) + (with-open-file (s f) + (loop for line = (read-line s nil 'eof) + until (eq line 'eof) + collect line))) + +(defun is-symbol (s i) + (and (>= i 0) + (< i (length s)) + (let ((c (aref s i))) + (and (not (digit-char-p c)) + (not (equal #\. c)))))) + +(defun has-symbol (s j k) + (and s + (loop for i from j upto k + if (is-symbol s i) + return t))) + +(defun is-valid-number (prv cur nxt j k) + (or (is-symbol cur (1- j)) + (is-symbol cur k) + (has-symbol prv (1- j) k) + (has-symbol nxt (1- j) k))) + +(defun sum-valid-numbers-line (prv cur nxt &key (start 0) (acc 0)) + (if (= start (length cur)) + acc + (multiple-value-bind (n end) + (parse-integer cur :start start :junk-allowed t) + (if (and n (digit-char-p (aref cur start))) + (if (is-valid-number prv cur nxt start end) + (sum-valid-numbers-line prv cur nxt :start end :acc (+ acc n)) + (sum-valid-numbers-line prv cur nxt :start end :acc acc)) + (sum-valid-numbers-line prv cur nxt :start (1+ start) :acc acc))))) + +(defun sum-valid-numbers (rem &key prv (acc 0)) + (if rem + (sum-valid-numbers (cdr rem) + :prv (car rem) + :acc (+ acc (sum-valid-numbers-line prv (car rem) (cadr rem)))) + acc)) + +(defun solve1(f) + (let ((lines (input-lines f))) + (sum-valid-numbers lines))) + +(defstruct mynumber + num + loweri + lowerj + upperi + upperj) + +(defstruct mysymbol + symb + i + j) + +(defun collect-numbers (lines) + (labels ((collect-numbers-line (line i start acc) + (if (< start (length line)) + (if (digit-char-p (aref line start)) + (multiple-value-bind (n end) + (parse-integer line :start start :junk-allowed t) + (collect-numbers-line line i end (cons (make-mynumber :num n + :loweri (1- i) + :lowerj (1- start) + :upperi (1+ i) + :upperj end) + acc))) + (collect-numbers-line line i (1+ start) acc)) + acc)) + (collect-numbers-rec (lines i acc) + (if lines + (collect-numbers-rec (cdr lines) + (1+ i) + (collect-numbers-line (car lines) i 0 acc)) + acc))) + (collect-numbers-rec lines 0 ()))) + +(defun has-adjacent-symbol (gear numbers) + (loop for number in numbers + if (is-adjacent number gear) + collect (mynumber-num number))) + + +(defun collect-gears (lines) + (loop for i = 0 then (1+ i) + for line in lines + append (loop for j = 0 then (1+ j) + for c across line + if (equal #\* c) + collect (make-mysymbol :symb c :i i :j j)))) + +(defun is-adjacent (number symbol) + (and (>= (mysymbol-i symbol) (mynumber-loweri number)) + (<= (mysymbol-i symbol) (mynumber-upperi number)) + (>= (mysymbol-j symbol) (mynumber-lowerj number)) + (<= (mysymbol-j symbol) (mynumber-upperj number)))) + +(defun find-adjacent-numbers (gear numbers) + (loop for number in numbers + if (is-adjacent number gear) + collect (mynumber-num number))) + +(defun solve2 (f) + (let ((lines (input-lines f))) + (let ((numbers (collect-numbers lines)) + (gears (collect-gears lines))) + (loop for gear in gears + as nums = (find-adjacent-numbers gear numbers) + if (= (length nums) 2) + sum (* (car nums) (cadr nums)))))) + +(print (solve1 "data/03/example.txt")) ;; 4361 +(print (solve1 "data/03/input.txt")) ;; 553079 +(print (solve2 "data/03/example.txt")) ;; 467835 +(print (solve2 "data/03/input.txt")) ;; 84363105 diff --git a/day04.lisp b/day04.lisp new file mode 100644 index 0000000..8505c53 --- /dev/null +++ b/day04.lisp @@ -0,0 +1,53 @@ +(defun input-lines (f) + (with-open-file (s f) + (loop for line = (read-line s nil 'eof) + until (eq line 'eof) + collect line))) + +(defun split-by-char (char string) + (loop for i = 0 then (1+ j) + as j = (position char string :start i) + collect (subseq string i j) + while j)) + +(defun parse-integers (string) + (loop for i = 0 then (cadr o) + as o = (multiple-value-list (parse-integer string :start i :junk-allowed t)) + as n = (car o) + while n + collect n)) + +(defun card-winning (winning numbers) + (loop for number in numbers + count (member number winning))) + +(defun line-winning (line) + (let ((card-info (split-by-char #\| (cadr (split-by-char #\: line))))) + (let ((winning (parse-integers (car card-info))) + (numbers (parse-integers (cadr card-info)))) + (card-winning winning numbers)))) + +(defun line-points (line) + (ash 1 (1- (line-winning line)))) + +(defun solve1 (f) + (let ((lines (input-lines f))) + (reduce #'+ (mapcar 'line-points lines)))) + +(defun solve2 (f) + (let ((lines (input-lines f))) + (let ((arr (make-array (length lines) :initial-element 1))) + (loop for i = 0 then (1+ i) + for line in lines + as count = (line-winning line) + as v = (aref arr i) + do (loop for j from 1 to count + as e = (aref arr (+ i j)) + do (setf (aref arr (+ i j)) (+ v e))) + sum v)))) + +(print (solve1 "data/04/example.txt")) ;; 13 +(print (solve1 "data/04/input.txt")) ;; 24160 +(print (solve2 "data/04/example.txt")) ;; 30 +(print (solve2 "data/04/input.txt")) ;; 5659035 + diff --git a/day05.lisp b/day05.lisp new file mode 100644 index 0000000..5a5fc4e --- /dev/null +++ b/day05.lisp @@ -0,0 +1,100 @@ +(defun parse-integers (string &key (start 0)) + (loop for i = start then (cadr o) + as o = (multiple-value-list (parse-integer string :start i :junk-allowed t)) + as n = (car o) + while n + collect n)) + +(defstruct problem + seeds + maps) + +(defun parse-map (stream) + ;; Ignore empty lines + title-line + (loop for line = (read-line stream nil 'eof) + until (eq line 'eof) + until (> (length line) 0)) + ;; Read integers for map + (loop for line = (read-line stream nil 'eof) + until (eq line 'eof) + while (> (length line) 0) + collect (parse-integers line))) + +(defun parse-problem (f) + (with-open-file (s f) + (let* ((seeds (let ((str (read-line s))) + (parse-integers str :start (1+ (position #\: str))))) + (maps (loop for map = (parse-map s) + while map + collect map))) + (make-problem :seeds seeds + :maps maps)))) + +(defun map-match (map value) + (let ((aux (loop for range in map + as l = (caddr range) + as s = (cadr range) + as d = (car range) + if (and (>= value s) (< value (+ s l))) + return (+ d (- value s))))) + (if aux + aux + value))) + +(defun seed-to-location (problem seed) + (reduce (lambda (value item) (map-match item value)) + (problem-maps problem) + :initial-value seed)) + +(defun solve1 (f) + (let ((problem (parse-problem f))) + (loop for seed in (problem-seeds problem) + minimize (seed-to-location problem seed)))) + +(defun map-ranges (start length map) + (when (> length 0) + (if map + (let* ((range (car map)) + (rdest (car range)) + (rstart (cadr range)) + (rlength (caddr range)) + (end (1- (+ start length))) + (rend (1- (+ rstart rlength)))) + (cond + ;; no overlap + ((or (< end rstart) (< rend start)) + (map-ranges start length (cdr map))) + ;; inner overlap + ((and (>= start rstart) (<= end rend)) + (list (cons (+ rdest (- start rstart)) length))) + ;; outer overlap + ((and (>= rstart start) (<= rend end)) + (append (map-ranges start (- rstart start) (cdr map)) + (list (cons rdest rlength)) + (map-ranges (1+ rend) (- end rend) (cdr map)))) + ;; right overlap + ((and (>= rstart start) (<= end rend)) + (append (map-ranges start (- rstart start) (cdr map)) + (list (cons rdest (1+ (- end rstart)))))) + ;; left overlap + ((and (>= start rstart) (<= rend end)) + (append (list (cons (+ rdest (- start rstart)) (1+ (- rend start)))) + (map-ranges (1+ rend) (- end rend) (cdr map)))))) + (list (cons start length))))) + +(defun seed-range-to-min-location (start length maps) + (if maps + (loop for range in (map-ranges start length (car maps)) + if range + minimize (seed-range-to-min-location (car range) (cdr range) (cdr maps))) + start)) + +(defun solve2 (f) + (let ((problem (parse-problem f))) + (loop for (start length) on (problem-seeds problem) by #'cddr + minimize (seed-range-to-min-location start length (problem-maps problem))))) + +(print (solve1 "data/05/example.txt")) ;; 35 +(print (solve1 "data/05/input.txt")) ;; 579439039 +(print (solve2 "data/05/example.txt")) ;; 46 +(print (solve2 "data/05/input.txt")) ;; 7873084 diff --git a/day06.lisp b/day06.lisp new file mode 100644 index 0000000..7d87c59 --- /dev/null +++ b/day06.lisp @@ -0,0 +1,59 @@ +(defstruct problem + time + dist) + +(defun parse-integers (string &key (start 0)) + (loop for i = start then (cadr o) + as o = (multiple-value-list (parse-integer string :start i :junk-allowed t)) + as n = (car o) + while n + collect n)) + +(defun parse-integers-after (string item) + (parse-integers string :start (1+ (position item string)))) + +(defun parse-problem (f) + (with-open-file (s f) + (let* ((time (parse-integers-after (read-line s) #\:)) + (dist (parse-integers-after (read-line s) #\:))) + (make-problem :time time + :dist dist)))) + +;; Assumes answer cannot be 0 +(defun ways-to-win-race (time dist) + (labels ((compute-dist (i) + (* (- time i) i)) + (upper-bound (l r) + (let ((m (ash (+ l r) -1))) + (if (= l r) + l + (if (> (compute-dist m) dist) + (upper-bound l m) + (upper-bound (1+ m) r)))))) + (let ((l (upper-bound 0 (ash time -1)))) + (- (1+ time) (ash l 1))))) + +(defun solve1(f) + (let ((problem (parse-problem f))) + (reduce #'* (loop for time in (problem-time problem) + for dist in (problem-dist problem) + collect (ways-to-win-race time dist)) + :initial-value 1))) + +(defun parse-problem2 (f) + (with-open-file (s f) + (let* ((time (parse-integers-after (remove #\Space (read-line s)) #\:)) + (dist (parse-integers-after (remove #\Space (read-line s)) #\:))) + (make-problem :time time + :dist dist)))) + +(defun solve2(f) + (let* ((problem (parse-problem2 f)) + (time (car (problem-time problem))) + (dist (car (problem-dist problem)))) + (ways-to-win-race time dist))) + +(print (solve1 "data/06/example.txt")) ;; 288 +(print (solve1 "data/06/input.txt")) ;; 1731600 +(print (solve2 "data/06/example.txt")) ;; 71503 +(print (solve2 "data/06/input.txt")) ;; 40087680 |