diff --git a/.editorconfig b/.editorconfig index b5f39e6..60b870e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,8 +14,8 @@ indent_size = 2 #### Core EditorConfig Options #### # Indentation and spacing -indent_size = 4 -tab_width = 4 +indent_size = 2 +tab_width = 2 # New line preferences end_of_line = crlf diff --git a/01/1_INPUT.txt b/01/1_INPUT.txt deleted file mode 100644 index a4dc984..0000000 --- a/01/1_INPUT.txt +++ /dev/null @@ -1,1000 +0,0 @@ -46threevqs8114 -threetwoonez1gtrd -6ffxbtff -769twotwo6rv9 -gjrcjrkvghthreegqqrg82qbct -zkxjhgprtrlcfeight795five8 -99seven3vdcgvmvxtjtwodc5 -three5eightthree3four3vtkkqrgxs -four863mrrnrsxrkone -sevenntgvnrrqfvxh2ttnkgffour8fiveone -49fbsfb -3rbmlsksg -ztgszqjjsrtmgqx6572 -3bqnfxkdbonesixseven -mfgx32ftpbhgngm7 -fzrpfhbfvj6dbxbtfs7twofksfbshrzkdeightwoqg -2xcftwo -cshmmltsml4fiveeightdn -eightthsix1 -two1gvfxcqnrfnbeightthreexznhbmmk -3917sevenvxqxntcgxskh -ksctcnfxdsk96drlbjkthreesfqlvnpvfbcbmg -8nvrmzfs46 -5dbgltmgg1xvtqfkdxsrxzltwo1pgqlqndlc -eight7four6rpbtmjzj5 -41seven -gpmfhninexxgqr6 -15sixdrhxzcmqf -8fivettgmcslxptwofivelckzvfkl -67ninetjngsrvcpxb8eighteightwofh -4nine7oneighthm -njtwonefvhjplkjgvsevenbjg77 -eighthrspkszngkpdtzdpcsmjnvlnhcm9pqmpkxqmbtmbv -ninehthhgbfsrrbpn2qpcflhgdvh9twotpzkvzmmsj -6fourzpjthmkrkvqkvvp -vnrnkfp6 -pfouronefour6 -87fourmznhvmt7 -nxbssjc1sevenvrcjlczct6ninekclbffs -eightrpzsdggsixthree9dhrnqtjcbxthree9 -pkcmnktzvdjtbbkvxhxpsfp8 -sffd124fkqsq1bd -txzsmrzlcnnine72kgfkcf -dbfbdskfdn5nine2sdr -eightseven47six57 -2eight634sixmlrkhrbslf -hpeightwopgrqmblthree1fmfnvd -2jbbf -vdsbvmjseven4eight195vdkfc4 -five3xjzlrmxvqznine -nine4vqxmzqxcvfhlm45 -rtwo1 -six8jddkprxvbh98hd -five5sevenfourfour4 -seventhree4lnxcvdprp66hsjfive -ninevrxxhgvkghmcs8gsvplvsfour -6bkeight3fhkfqvvsbcsixljfive -6sixktwo -lmscbrnlzmbqpl75ptwo64eightwoxcm -2sixfivetwoeightdpskxjtlrfive4 -87gfmklvnzfz4594qlksr5 -five3one65 -vxrnhpvrrdd7nqdjfqnhfglfive7qqtzhcrk -7sixthree441pf16 -11hrfdvdkf -vst7three2vtwojrkdkjltgdt5 -vqmtwo5 -nffpcvfpjleightfiveeightknmjfive2 -ddfhzdndxvhcgjrcmqq158 -kkeightwo14 -8onetwo -sevenrslxphqpcpdnxhpzqdf1twoone9 -four8onelgqhkmxktf5six -8ckshssfour73twoone -threethree8onefourkkhvfive4five -64xpzhxtsixseven59 -two8srjslxss -sixsixninecpgjkfhzdqdjlc48seven -lpjgghdtgk1sevenzpkmxzqxfourthreethree -cvznpxfhj2jnlgmnbkdsix -ninetwo1fournjqvsb -sxhl3kc -mtllnjrbscfkdhseveneightgjr4one -qnineeighttwovjsnvs7five4svdmjt -bcplhrpvmkxkjxlzl7zkbpdnoneninethreej -1mbmfktgtwonine -9threefkptqhhnine2six1fgxnvvfvplv -8onefourtwoxl42shxq3 -38rlbhvlpeightfivelbcm3jfd -97one1threexjfsljjz41 -kqmkvmh1three9three74 -3fivenineeightwod -6sixkgnqqb6 -sevenjdn8csthpjxgnd83 -qhssrppqxlone649 -3gjpsncshmnhkdpzskmmfst3sixfive5 -fivejprgsxddzgcnrn6cpnxnj -4three3ninedqknine -61xfrcfseven6 -sfpqbxbdrhqkndfdpldvfive7gxmnthreetwofour -lbvrzv2onec2six8three -ninenine2grvzhgtgfourthree98 -1579416 -5fzcbbxzfjjtwo6k -xmxbtqvnxf665lplnhlgjlkzhkkbknjcxqvkpsp3 -fivefive26fivefour5 -5dbxqcbbkjonehseven -1k -8sixqmone9zthx6 -ldsmxpbkkx1rppscjfour3six -fivethreethreekxzgqmrz8 -lxklrjjmqsix5snb7 -threethreetwothree6 -8three6 -fnine7jmmseven3 -rfhlkhhlx8sjqgclvlsctwo -vrzpdfjs5fxldpnhvhmmxhleight -9tmqznszjgrnlhnpxbc -3sxfscfseventhree -565vs2 -four86six6 -16 -4vbcrh -62jrjfrdcldbvjzhp -onecsqpbrxpmqtrbbtxnrhkdlthree3s1six -two798tqsjv -znktgzzmtwo28 -8hllzrjqhvfone -tgnlbtc2ninejmcsixfour -fivek1five -rklpvqfvtwo3 -lgdgchcpcl55hfdmdj -onesix7onefive9 -jrnthree46seven -qqptcnrxlllvccssrkkmkxnz8 -cmfour8threelthree -xfgqc36oneightvlx -xrvrchbdhftgpn22fgmnhbrscfqrqpgzjmgfive1 -stwotwofourfourthree2 -eightjcfqthcvcgpxxl6j -cjvfdgmplfeight9 -591eightwoc -jftninejfb11one1zqpnine -threeqndgjdfive4fourhgcsbptb -7pmxvqdhbhf8six -67zhx64tlnjkvhvv5cblxd -29zqfive3jkzmbj1 -smvlmnph1seven -61four -zjmgnbkoneczgsftnhtvfbtjvbjzpspcffrdkv8 -threesix4 -fhqm8 -ninefour1 -two422dqjqhvhbqkdqf4sixoneightgrd -llnrdbhthree778dqzrcplfoureight -eightjblmbgqhrj2onenineszr2two -8cxbxqssfkzpponeppcqsx -seventzlsxrskxqm8threecrclkpqjpmeight1 -nine1twonem -6threeckmkktkvxjteight559ldn -2zxhldmvpqdcddsxpnnvrvxmc99 -fourone4dzftfnccnvzjdrg49seven -7eight44 -xmjqm8two47rpjfninethree -7zhmjjhtrqjcmfprhsix5twobfive4 -rccsqlt8 -seven6three -lrbp3five19zxb45 -8jlbtllzbtdgzbcfln929 -kdeightlfk9two2fhgshhbzhf -dvxllmfourpzfpvch7 -four28 -3threefour4hxmfbmjdheight -6twosphthbbqcltcgxm5ssvqndphrnine -438rrxntninetwophsix -eight3eightnine1sevenxsvfr -4643kntqsvgqqtwo -two8two -7gbxkjonetncmeight52 -kg517 -onetwo933 -fbdmpjrjsscsfvfntwofive8tzbrbjsj -7eightfive9nineninednsfhzvtonepccctxssbc -93twofour2eight -7bvzknzdmkjvrxkfngfnsd4foureight5 -onescsxpcfivelmqvfqxmc99vbshtgzjkjfour -1hvdnine1 -542zhgcmvzcj3threefrvlcc -sxfc95seven3 -nczqknxn4four7xj81r -8threefive -7zvhlf4 -drbxjhqp9gfgxxtkl4 -five2twotklsixfour -9four9 -2jkeightthreekbqbkffpsztwonine -3vtffqfkfh9onenine4rqxm7two -4hlxllh7nrlxcpnrrcfivebkfkjdfjbksnine1 -drgsb3four -fourhscfkzkjfcdlsjgjrbmlvvcfgcmxtsixjlhfrfmk8 -ncrkhfive1eight1 -8fz3zkhgleight9tqsgnbfoureight -5six26twoone3two -ptksmjfkl5twothree4fpshnrcfrmqxeight1 -jfkccclrrr49four6eighttwo5 -threefourgj7eight6 -73slt1one5 -six1zrlfk -5six17 -qrsix7sixonexmclfz2 -3fivethreebplrfgklj -xz9sixhlt4eightone -gkknnbzkt6ffourvrjbfkqz8threesevenn -2onenine9 -czsgh1five4qtxmtfksln -eight6fourhpppr -lpshxfqsddeightqrfgrdn1five6bnr -5lmmlszndzfoureightqdbhlt7 -9eight5 -8sixrpctqfgf9dm95znhx -1sixsix6qpmqmtwolh8 -six4threenine2four982 -8jbthree59nine -q5 -9twosixone9fivehdsvpkttbkcjdbkone -sixsix4cldngone3four -9mvsggrgone9gjhfzdmvqbnqzlxgpckg -gmtqnkdlfv8 -8seven7rxtzksl74four -bmrtbjzqhbgzcjtwo74fourfourlvj -twoone4five3twoljrznhdcggone -42nine1eightseven -45fiveoneseven6 -mxfoursixone8coned5 -sntmhcsix633seven -eighttwolrcrl5four -p22 -1vspmvx -cpcsx9xgqlmblhshvnsix2hnczvdrrg -grgtvsqdtslml4tlqrh -hshgmv3 -fivethree63m3one -95threecdfhqtmqb -xjvd14dnfrjthqxvvq1xmqfhv7 -eightnzx48nkqhfssix -8nzvck4hpfxbstf6fivesix -4drxbsxgtskqtlnhgrrrz -6foureightonezbpdbqflp5one88 -twofivefbhfourone4cpnrc79 -5trhksixfivesix2k7 -25three -1phc9zhhn -five8ptkczvqk87gkr8 -six61eightfourjjzrktr -4gxrqrrvkshnpgnrjg2threekpcrfn -7bclvsb1glbpss -2eighthdbvxpz -439 -3drtsf2two -ninenine8hqqmfvddgspzdsnine7 -xzrjqdlrp2threedrhjztbsvg4mmqvchlhlp3 -99threesixzpgxnseven5one -2hvst -twohvrvp164one -1nine9seven1eight8 -dfkdzprs95 -zthree925fourf -kssmqhkonetwozcjgvjgxzr3gfdcvgm -bbsqsix6 -onefour9seven73 -onesevenx1ncpgtczseightssevenone -419d43dzjlvn -ninefourb6threezgqvmzklghgsj1 -7crdxpfkcmtqvbvkk3 -8rvp2p -gnvrlsfjxtfssqz8two6dcfive -jgtwoneoneseven7oneoneeight -dfsccdclmffourpsqggngjzn3 -22brtxbtkkdfmkbmv -sixxlpxqdtwo7 -six8mrvhptlfbmczlnfqrgbvz5d -84fiveeightsix8 -nine5rzqxp99gmklplmxtveightwombf -seventhree7 -mfklcxxbhpqsdt2one1 -two7seven2 -63sevenpmdzdrkzjkjzgnnseightjztlvzqhx55 -8twosmrgbzzgmjbnthree -twosksrj4mk -onethreeseven4eight -2kjldqzszg7twolfivethree -3qdnbnzglheightjtnlqqqt5 -6l4vddmkphgmb3vcbsbgclkzhmmtmfour -sixvtzmppfssl35eightqc -six924lt5 -5sixnmmeight7 -mkggvlrdhkjxcr9jcs2fhsptxhj3 -nineggh1 -qzzckckm3 -hxgjhxthreetwo3x4 -7qonejntfsvpcftwogxkvpvbj -2twoqlg3 -1sixhvsclvhshbr -seven8tffqvgs -twobktthxfqqthree38 -397 -lpm9six31seven -75nrrfxrj -8sixfour -ccfbzbjjqlgkbqnxhgd2 -7eighttbrtddvbvrtmxjeight5nine1 -sixfourvbjv5six61two -sixff4dskpsqsrcd7 -three5five8 -8sixthreethree6 -oneeight7cdjxfmfjbpbjlsevenjgthreexh -ninetwo4xdxmxpmd86 -eight312 -pmvgbvn8seven -djrftlbzvfxjjgrh37bmfkone -ksf53onefourfive6 -7vzqrmklveightnine -two55eight69 -kbjprbkcgpskbnthree6gznqk5fkttt -22three37bvmsmjmx -zpchdzmbjhzl1five26threesix -2onetdppvzcbzfive29four35 -66one9clqlkbqpfdqkkxv -lql5four -two41sevenseventhreeone1seven -fiverbkxdczfive6smlnbgn6sevensix -lpveightwoeight9two4frfz54 -twohfkvxqrninesix1 -6twosix -9ninefive47 -sixsixrjznqb33sevenhkl -one5nineeight48zqkhjgqlcq -foureight4seven83 -zzoneightvcnhxlmgjp4ctclzzztwo46six -2gljzksrvdr21ms -eight75twofive -threexdsbjrf6 -lhvrfb3925six -fgrlrvpnctkdblxvzone2tsxst43 -zpnbvs5foursevensevenjleight -five89seven4seven -5rnntxqsngssixonefb3fourdglmstvmft -tmvldx3eight163 -hmnvbpr6516 -3jfqshjf -9vgpgcflbbonejhmlncrrjvxdcshdflktr -vgjmhqnvghc718sevencfdzknkhonesix -dlzrjfklp3chqxjdpdrv -eightseven4tcbdhrgssmpvxsxszxrmpzrt7 -five416sixp2 -2threefourj -hmzoneightmvrksbxbjkvpslkv1tlxxkzsgdseven86four -pzleightwo774five5 -dvsmtwokrzscgnvztznqh9 -6chqttwo -67sn3dfdeight55 -4oneightqd -jhlhcjnd6sixqptqlmrskfive1 -9mfxbvb138zxngghqs43 -2srctwohfplclone928j -7eightsdsxsskkd8five82 -gccnsvpnfg1195nine -8584threethreeskzkfpdhz7 -prhhdpfivenine5fsskx5eight7 -9nzhbn7mvczcqcfive7tslfive -vqxseven5seven4332 -95sevenninefive -eightzdnddmlrpbxnvxglqnqnr334hpjrl -one6three -13dhjftxnp5k -92threeone3seven -ncsfdmmft2eightmlfxxdbv -four3ninethzh -31five9ksssbdqzlfive -twokghhrljdc72 -two6fourdktfpddftwoseven -zgr3bdfqvnkdvpcntkrcfnhpnpdrtkzpthree -9rnpxdtkbhjbjnf -1247lqdnsgnp3xtdxnbxkrthfhsrm -sevendcdbr38ninebljxshxdzqcknvld -six3gpngxvdqlnrf9gjqjvzeight -twogfxctgnb4sixqzdmhc2sevenbq -sevenpjmrj2skcc5 -eightsix9threemxtx13zczqvtvsix -1tmgrhxzfql9lbpgscnmlcghptbtmpfgct -2foursdhmtqmfjlf77 -bmgttpr2eight177six9three -1nmbnkszc -three14six1lnlfpfmfhm9 -eight4four6five46nine -26sevengdnoneeightfive -vhz1fivejzjqnfgrpfbgfz11nlx -4jnkzktpninejc -ninefourone1five2four3 -cljtfplrgbv6fsrlfxqmxhtwo75two -41htzjlzsdbg -hfnvdnninezhhbsmxfour3ninesevenhdnflzlt -8vlshckcch57 -28tsbvgmzd -qccgcsqb5trsvmmdtninehbgsxqjftrvsix7 -3eightkfqlsone -fgoneightsix4eighteight4one -8csdgpcbfjbmsixmjztbrqdj5 -9two152 -onevseven1 -vfsjtpzttxdrfive6 -69mdbtdnqgxjmzt -threemgzspvnvsjone7eightjxssg5 -threelfslcjhhgmfftmftfzsix3qs57 -onejhskmbxcqpkxjxh4threeeightseven -hhvgnineeight8xrtvmqjnkccdptpvqxlrdkkgljmbnzx -onezvj2threej5dlnrcbhfxlkkmkpx -ninepmgbdcvpds3onefive2 -9tblnmmeight1xdmtwo -cnczmrhjmmcsccnine54 -2fourggjjrxckgvsevencpkgqzzfnptwofivefive -61threexnrhqbhxb9 -seven14 -32seven -4cqtssgd3vdxbnllfb2 -smbqxbxgmeightthreeonedsfxfronec2nine -3145fvqz2 -bgdgbptnr9dqmvvckb -tpt2ndklfgxtthree -four16vztcgtwo5xkjmp5 -59onelp -ztwone9cnvbtpglsq78 -4rmmhxpqsknxhgqmlh9tfzfngqsnbqdmsgtcjsbntr -4x6lcmrxhhkcscxgxtgpjz33seven -cnzlsqbvk8sbbzphzkhmeightfive58 -twofour7 -jcsgmrgeightcpzbb8135 -4grxpsix7hgrrhtjvgq68zzbvsn -qc6 -sgxdninevmmzqdkqmjxpksixfckbjjkgqtwoseven8 -6lhfcjc9 -zkpkjn18six51 -xtnhzzxceight6seventhree27 -qttwone3seven5 -threeone8ksgt9 -8fqkddzb -nine3sixbprlvxpniner -dmbvmrthreefcrqvmhp54neightcz3 -twosl6fdtwokrqrqtwo6eight -8dkrshdpj8threer -27snqfjdg -nine7mdsonenine -threefive2twotktc9 -1twoninesjgqjxphhnineeightthree7 -xxlcmbnctsszkjdhfzqbdr2szvkmscnrg -tcmsnine6ct -2tqmkfmc -sevenpmceighteight1 -hnnthreefourknjznt5nine -5fhjvttdmzdpkjdsgnpqxlxfninepgrsns -psxzzdkspgmgnnhkzt6fsdmfour -1lkb -seventwo2dglxkrlvgthree -seven27kzhnknqltvkbxrtvtwo -7frmrdctninefive -61twoninebbsbqsbhtxmxkffspd -3nlzgzlntrk965nine8ljpj -3pfxjjvcg42lzlkzfs -7pkztnine54bq -sixxbxvgsknjxsix4nine3 -fourvbch2cdrsrxzh9 -one1f4mtvslfczm -456bkzhmxlmhfmkgxrmkbmvhhpmsfk8six -one9rmbvtdp5oneeightfive8 -67zh4 -83hdqrsxfc2twoninekksg -1gzmqcrtksixseven81three -two6threefour2 -nine4rcmbhmhsttgqzfjdm -jg63 -twofour3one1 -5eight1eightqdmgtszxvx26nine -482three9seven -cxdjmjsk1mgqsqkkbq97fourqflf -bvfplgzj69pqfcpglsix6 -v3458fourcpqkn -seven769sevenfive9 -dztdmlkjgonejjpxrsevennineninepkc3 -4ninehvgninethree -tnvgjhzr6 -sevenfour5nineshrsknbbxxsgztrl -four4flpgsixshxxtmnvxfivensznine3 -73cfxzzsfourzqghjqvkbf7six8qgcd -fgqk133t -vjbzpkvsxkoneoneeighteightfive1zrvgqbf -9six6ntrmhtkgrj -fournrrmxldk24mxhsevenfive -8fiveninenine25ninenine -seven1xb3vbzbqkjdvseightfive6qs -five8dgqkhldbsfthree7 -six11three5zeight -hgmqhchrdfivevmftjcgtl5 -oneonesix2bzfsqvkmjzbdq1 -fourx5threethree3mxhgtnine -hzeightwozfcpkjvfour3three9b -1oneseven -hmdtcxld4fdgfgdbjlsevenzrkmnftsevenvsqc -sevengzpnkfn1sevenjcbfxbg8six -2sqjnbtskft5 -fknxnxg9944hvtxj -nine3951 -94sixqslqtxleight -1zpbxc3 -sixddscq1zxsvgbjnqjj6zknkfczj6fxcqmf -threetfvhftlzjn72sevenljtwobhgvvsttg -doneighttwo3vm -llhzdtwovbxr2 -onemjkvtbsix39eight88 -lhzgpqmhm4ptmcxhseven4eightcrvnqzplrnb6 -3tqljjnx47sixsixmxqbflxjp1 -tkvdxbbsdpkdjl3gtnmjdxhrj5 -qgnnghvnkppvvnine8 -89sixeighthmhsvbsg -67hqvxtmq -fiveeighteight7cfmdmfhdld -nnsxvrgpeightjvcfj3fjeight27 -8ninefourfourcjrbxone -1bx482 -pponeight1seventllldzgdvgcdmr -tworrjfkmntbvkpseven4jnrllr4 -ninesixsix9 -csv2ninesixtwo3 -9vzrvg9twokbjcnvcghthreeskfpgssbdxq -foureight6133rszlz2zvxdx -6jfklqcdrgm -3sixhds1kgfvzknhthreefive -fbgnjqhnghssthzshktxll7rqnhjqjb -5xjkchhffgz2 -threexjkeight86 -three8eightztthtfvzdxthreethree -gdxjvzlktltseight5 -twomxfqrxqkrjhs4 -fiveeightnine1ninekhrjbmqhmpjqxtqsjpzbbvnbbzmfour -nxnrqtsplonefive6zrthree -8fivejmr1lzbdmvdpdrhvsthpvone2 -2sdfs1threejjxvjxp -jhkeightskq7 -1eightfive4 -fivefqpmq7twoeightkggxgvrbmbhjdzrmn -5twozrcnf9fourtmxjtkmfiveone -hghfivedpgntxbpndqm4 -twodzbplxm9xlgvnmfvxh7oneightzvm -77eightsixxlvkzfive3 -qrgz7 -eightkdcvchgfourqtrtxtnzeighteightseven1 -69onefivetwoone6 -2onetwothree81qvsmzxpvmpbgsd -263383seven3rrmskzfgcj -threeeightthreesixnzgkggflxfour3 -ggk6two2sixeight -eighteightseven8nine9six -pzthreenine2nine -5threefivecpxfjoneightjcn -mdmhone4ninesix92two7 -nm2twoonerqvckjtxjlzvldq -6fourzxgncsixninenine4ninethree -xxflpfeight5nine13qsgrqvsz8 -1threeseven4mvfzm653 -eight23three7dkgdxkrk -9lqvhv115threezmcnbplgfzjlqmgrpjn -2pgphcxbglfive5vtldzlrrnx -dshlq2zcqhzssbdseven5twothree -eightpvqcqnsprhtvlh5 -789sixtwo3 -eighttmzkfzksd39sevensix8six -bkk5two -gkgqxksdpn78 -577gnmbvzf7 -rcfl6foureight4mszdbmkl8one -17n -fvnkgxqlpflmmnf8eightsix3twokgj -lh84twosvptcklvt -62one -lmlbfcxpdqlmeight94nineknk -threenine5three4qqhtfkg -3nine8threetwoc5ninecxcc -sgxrhdonefcpone1tsb -oneqjkppzkpmzcgqv7nine -lfngqdlhone4rhfsrgdldl5mrpvzr9 -vvvhfbz52eighttbbr -9threethree -cnntzjvnplnineeightzdmtsx6 -4ninefourdndsvnbthree -3zbt3nine28 -1seventhreedfggtfvvsngszlsix3 -six13nine14 -9gjzdmdzssixone -nnxbmrdmjdhrjnhktlprtbvknninefive3662 -6rrmxmfm479tcxmvk -ninedfchdzxbmlrjkckkjpqqxchz58 -three22sixeightrbzmdlfztwo -jqljmhxgmfxkgsevenone77ffour -9xbphsix -onetwo271sixninek -sevenbdxtwofivexscbkflmkncvh7 -jxlqvscdjz7six62 -six4five -eightsevensixone7eight -five4five9 -btsjninegdrcbxdrgmmg23q -67mqtphlkhtp -3drdmqx77 -8twoninenine -eightfcng16kzgtfzbdfxbltn113 -fc68 -3rkqrhlskj8one8 -eightqtkls21five99 -41clcg5qmfkdkq6snghpone -pdmnvqhg8vjrvlld9ninexcglqpgm62 -7one4two2ninencplhmrztsqjgt -6cvdc -2sixone76eighthqrlmfxzk -six512nrsstwoeight -2fourfourqlctwo -sixb23seven3eightcbmvk -jxthree1bvtwombbmcdbsbf -eightzdqnjbjzd9sevenflcqqflk -four88sixtwotnmzrltlnineoneddrsxk -9six5 -5ninegfhvsqblftwogmmfgddncqfmqjtqvbc6 -9svv5jlfbrvpntgpqkkg68 -khglrpxfqqfour4 -qkfour1sixfnpzxkdzr -22onefivemhsxvhllnzr2 -1onehpdqbrklhg -bs6sjsndrz2 -8five9 -ninetwo3five5xmpkzrnqzq5 -2797two2 -91tdmpxtrkfourq7fourcvtbmsk -four82 -three3sjgxtp86eightwof -sszzthsixvrdbglczld3 -four1fourfour5sqknhn -vlhzqfbht8px7kznvtffourq -jshqhczgr3 -4two1fvvxdfms -seight3fghflv -tgqdzsdzdthree787 -45nrdlxtqggcseveneight -87tkbsmfvhl5five3zqx -6rmpdxvrlszpjtqmhcd -fourtwothree49346eightwohq -9kkgdv -ndoneightsevenfive8 -threeonecc63pvgxd7 -ctwone8zbxbf -foursevenrpkshs75two8one -2jsvxtrrkjxjzxmh -nkf8three -gzbplsixeight86lxpcrzxpbx7seven -5pzpfs -six12ssffeightfourfivefive -one2four71 -5onebhrjgrrltbsix -hclv99two89nsfdfour4 -8qk8fbflndsix9 -lmvcprone16 -rknqlczt15thqlpvk4pgllfmsix16 -seven8jgpq427sixtwo1eightwokb -nine8xgghnfive -nineeight7ninefourrtbtd -threetwothbdmvtcrjgsm3fivehdqlxtxnkdstgs -4sevenfourvrqfkhspbkqjcxjkjfniner -5three69mzqfqrhrjdqhbpmscz -478kj1 -5bhcrpjtvjsxpskmscxclpzxkzc8five -sevenhlxgzntwo4knxtcqscdone1 -three5dmjg -ssxtz342sevenfivefive7 -84two9vsqlbh5fivefour -4fiveninetwo -8cqz -twoptxmcmnsbgrrndfdgtwo2ppglmzcfour -hdqfnlzrscveight5plplhvbg -sevenmgxjzjtwonine5 -2thfbhzjsdk -jmzsvtqjxmgstbqctdv8qc -gv8glpnsixninesxhzbmfqxkqfd8eightwonj -88vsqztnhst -sixgf2sssrzvqlsm9one26twonedzq -4five611one -sixdvbsctpqbqfive6 -one3c -xcnkrcdxtfivefour3nine -7srqvlkftzztpgrfive2threesix3gtzcnfdvs -3hqsevenlzgbf -cggclvfppfive1dgnnqgzqzsdhdpbg -noneight9tktnzqnttwo9fivenine -2nfourfourmmfltjvxzfivezfntcxfctqsdckcjl -htzvlsixsix8twoone -91xnrqfdqsbrvf6sixtfour -hvtwonenzqnine9fourvtcdndzptfourx -sixfiverp8fourbnfgnlkqld -1728 -18nineonejhbvdbm22jgrbsgf -2rcpqxgsix8fivebscvblxzcmbztrlsx -9threetwoeightxbsrxpjns4zkpztwo -six6sixfive -zpqjsckrcztv5 -3nvsixdnmfqplqtqpq9 -onesixeightthree6nine74 -66sdh -235lmnrgxztt2nctntsgfive57 -fivegnzfnbfpvnl72fournine -3jrfive9srqvsxxfz -vs4threeeighttwotrcpphdq -zlfcpfptwoninescshbtcdv58sixrkxfour -eightfour8 -4onesfkbnnfsevensix -fourhjsbvjgqhrvtdvmrzrtsixpglhrlcrrkr2 -fourthreedczqpjskdsqnnhczhdc47 -3sevenfourtwobn -3fivesix1 -4qbtlplbl25 -66grjtlgsbflfjbcdmdnnine6 -1rbszctwo7pkmvsixsevenoneightqc -snpvmbppvtwofiveeight1rnmfkrsfbhs -5frcvcsixmlhfcv -2nbd -557sevengrvxddpdgfzsqsqx6three -five41lrlkdmhsbjq -eight3vzzgspkgqh4eighteightstthdqm -vqctjspmq9 -four12clqrgts -45two8zv -c4xklll3 -four3hhfivedtj -six55two3 -gxdttwo256 -njthree45 -7threevl5174 -bkvcbfournine6seven -four8jjg -725rgkxrztbhjmsbxgvc2 -ninetjqd48 -xbpthl9x -1sbf8seven -qfsbld6five7four18 -9kvbcnlctngbthqlbqlbfhttmf51 -98eight3vfcxzbsvfour4one -tlbpdxbglrcqppkcb6two6rbffxpzmnntpdr -fivevgnzjkjcfeight7twozvseven -vjmdjsrl8onetrnlgsclrfmpvkdblfourktwonet -tvvkszfvnineeightninetwo9 -2twollqsbnconescjjj -one23qz -nine2vbglpdpvfhrqp8eight -threeone7seven -vxxone8onetbgplp3 -two1mlqrfour7 -ninezdkbvkbonetmzxgszqxdnttkgsgqd7eight -vrfbzcfourfivenlgmvktszpthreepqkgfnjfc9rfmkxbv -ninezhsfngmbc5fivers -tzjxrncfnine1cglgmnmxhssevenbdmxfjtg -sevenseventwo5five9seventhreeflvgdbstfr -7rggpvgkmone -1veight -41vk7two5 -7onetwoone6 -kvm25nine -onekzcjprtxbncpqchpxpvtttvgmqfour3pxpcmfourtwo -chrrlnddfivefive5 -ttvnlchqz8hrxhmgqrfour9rmkkdlr14 -5jcmdfnldlq -6431khcknnine7 -onegtmzngkqgfggfmhxshnzltdbkvmkjjvnfpkclhxntvngvlnqd3 -q4fzzrpt -cllbnine5 -six18ddmk22six -2knsdjp2nphnonesevenfive -vqjkllm1threemfrnlvrmjzzsnhmxsxtwosgxjgjcqrtwo -six4onefhpxkpnqfivekbxhmxtbx -djsptzspn3eighthb9nthreelhpzd -twofdvrmxrcmfive27zdcssbvcsthree -5eight5ptfgcnthree1zjvkk3l -3one8two -bsdphtbdfour1twosevensevensix92 -four7six4smppkbtwo4 -87dpqjbbtwo78662 -1ninefour8four32 -232spbt1jfzfourthree -3cxxkqldtwosevenninetwomcdvls7 -5seven7pgnkdjgckfive -rvmfpjs2threespszkcvfklpdhtmbnseven2seventjrhx -eightfive3twonbxs5 -3frglvrm32 -19778gmtrsjkcrdqlptpjzg -zpvskbdztrone5eight3sixnmcpdshrgblddrht -7seven2tdnblk782eight -mjjldone2cqmlmmzxbt -hfponeightoneplk66threezzklrkrmvronekhqsrnvm -lghjkgdssfour423sevensix -sevenfmqtwo1onecmrhrzhl -dmpf2fivethxhpss27jn -2lnpfrdfour6x -onetpztmmfr2 -66qlzhrrlchcxznsjrfxqxkone -9fivenlzrgm -mstbglvtxnzlnhjrltwo238bsfourczkvctl -zkz6dcdsfgssl8b -cgnqsdeighteightfourhnpkdvggdsixfour3 -96xschgpnlktsix4eight537 -31c -4smrxzzpvqmrxhmltcmgq8zrxftd38 -onemncsrqlklxdx9ngpbxhxpk7 -gzr2sevenhjsczr5twoqsmhj -nkfh4eight9gzpkvvxjsqfjbt -two2nine -cxxqmzfnm3mbsmltpkpfour6fourfrjjcztt5 -lxnqtpzldptcvnlcggonehndzmx7863 -3fmgl36lbcvrrczdfqdss -fourfour4xjxgmnctwothree -nineseveneightgrdvffkntwo948 -fouronenine8 -8xfktsxszhn53 -6onedgffr57 -krmvzbhctztlpfour9fcmdscctdhsf535 -fbjgdrzxv1four573vljtseven -8three9ngrjrhh -1gqfoneninegzpbjtbd74 -6vkf -9eightzmfsbxqttg1one -56k9ninerqprllq -jnhlpkbxvm6three6seventwonegp -j929 -sevensixnxgbtfksix5fbdvgkbd77 -39sevencpdcbnshpcsevenhggbcthree1znldhfngnk -618fourtzfrql -kldcjxktwo5fivetwoninehsbmrgtn -msvjzqteightthree3 -2xtvr581xsbctkfftjprmb -seven13dvstp848dsbllng -sevencqhmth7tdshrtrphx9 -three2eight8six6 -fourprlhnl7vczqdtl8bjmncrrfpzk -5four1one5 -seventhreethknine5 -two6vqgpzvmhlhfourklvxvhmnlqnmrhknstwo -4bvxhmfz2bktbfltj -nk9 -xjb713vmxzcfxl3ninegkjrcq -rrmplxeight1znine -zsjgngpfourfoureighttwo1 -99twojqzlggpseven -eightfivetwo7 -8ninevlkxsptd2ninenine -4hrzzjxp26sixpxjxphmkpc8 -vlqsf4ntssmfrz -eight93tflqhb9two76six -ttxfgqtrfournine9pqqgd -7274mmjgcssvrsix -1threesix5dmkdtjsmptthreeqgfgsix -msrtbbschxmvcm2ctprdlnkdzthree -dztlvgn3two -h7crsblhtp -seven5eight7qrgxlninethreetwobbsjdbxcvt -2hfbeight -eightrdlfourtwo3vzrlsbcjndnineone -ljxbtvhztkkb4three94fiveeight -3fourkbpmpctthreetwovzhgq -6xznbcgdmng -3jl5zlkbjpeight1tvmrqdlk -23sjvtghccsevenninesixzlhgzqtkhb -xptf34eightp4cdqcv -gfneighthvf3nine -threeeightthreenineninethreetwoone5 -9nine22qdfzgbdsd7two -gfourtwotbxddnxzc2 -four84gxllvp76four -t86 -nheightwofive525two -hh115 -lqvxpsxthreethreefive34three -sgvqhjqdvtzfnine6bgjcbn2tqrvgfmdtdbh -nine2seventwop -7hllxxndzggvsrsh9zrktwoone2rxqczzbqpx -s2one574 -9fourseventzqfseven -62six1jdqcnqm4sixjsjvnx -five6fpktwo1l3 -five1d2 -fbnoneightknthree6 -4fbtxqsix6dxpjclhtlk -8vggprkfjrpqz8hhlvffmfiveone8 -rz29eightfghseven -two9four98cgmntgcncsmppz -bmrvhsz4twotwo -1oneeightthreeeightfourtwo -fivethreefvz9rzvzdqxqbmtxcnqc -3oneqvseight56lkxjk -6l99six -dsevenninefour48kjs -1sixxvrsevenone7 -lpmdghtcdj3nine28g77glk -tnkhrdone1hhtfzhnz -4cpzzht -foursixlmtmvrptqonejmssjldcnz8one -1bnd5slzddmkmvthreep4three -7jlrm -seventhree3 -vmjsix8sevenktbrxnftfour -gmczxbkcgsixseven6six -9oneone2hhnj8 -bbpeightjbtp4qfpks2four -twoeight3 -7mqnzkddm3hrqvhdvzgvgbnfcjtfour -4onesixgkcsix -chmkonenine1btgnldh -dpxzrthkjzdfkgpkdfvxveight5 -hxlfiveeight6 -3xlkg23fivethreesixeightksmc -nfourrjdqx4four6 -ptzrcdzthreer3phpkqlftwo24 -five7sevenjpjmmppfive -11sevenfivezcglsdkhqffivethreeseven5 -4eight5mjlkzrgnmlnmxntqmtlxmqlkjccttcpmgznfouroneightk -1oneightx -25fivevhtpblpfthreefour2xrzsix -eightfour41four8fiveone3 -pxmrbcqt22vfvzvvp4seven3 -3zqbqnnonesxtgz9eightonepqnld -d2six5dmlqczzrtp79brzzq -nine48 -ninevbjkjcd11qhtvb -six4nine1four2three5 -lcnvnxgzssonethree5mnvlsevenclrcpxbjbzvhlj9 -8onethree6n1 -98ddgtwov6nzvjzsscd -bklvmzjrqgfqx7 -5eight95ninetwo8 -qcrgbmzlztvtzrsjsixmvps2 -jsnmkd9seveneight -mkdzj28twohhmkctnsix -kb38sixttdhv9three -8eightninetwo -twoppvc7 -sixfour5sj6cdfjsskfb -242p28mxh8zrkvzp -sixnine5kqqrhxms -21sixfivepmspvnbscjc -threetjgcjpvflndq98 -sgonefivefive8 -nine5sevenfouronedsqpkgpthbeight3hrfdmcql -1sixkhqpcv5 -bsnnone3 -46sevenbnfsgnjldbtjnsjlmhvjrp8sevenx -twotwosevenonelzlpnmkdqq2rqthff -sixfournbzqfhff6jdlfhpt974 -5sixnvs2trqprv -nine8ninefourninelgcxntninektmhgjqrpd1 -hsjmpqkpkqzjnmgbz2nine6four -6two7jzfivethree25four -twobxtwosixfbhj5prfntlmfour -4lfsevenxsvvlmbzcnprsix -45lxtrdvsgfzzcmzjz7ninenvcvc -qfzvfthree9 -sevenlxfzcsevenseven4 -sjpqvfmx9twonep -qsljtpgdprjbkgzcnv5seveneightseven -zmhdkvltbxv3qftmt143 -5sevennh68 -sevenfour6rg -1sixonesixfournbbz9hfeight -sevensevenfour265one -88sixtwo -one5rcczjeightknjeight -qgftwohszlmfgjnn7 -xbtcpx3htlseven -7tnmvjdj4zlltljq8pdlnfghnd -jcpcgznmmnine4ninenine -zvdsbmlvn5four555 -threejpnbcbttggm9onefour4vtjhdfjsnz -7x7 -veightone1 -eightjlkckhqjfonesix94twoeightvggdqxgcn -2two2fdzkxgfour9sjtfourvxklldpvjm -849ndjngjhs65hgvdbcxps -fiveeightsevenseventfqzdxnhxkxgmnqmdjmxmdc35 -4sevenqnhvszlfour -seightwozbjkfsgk5three1tcpbshgfzeightfive -fourgxmqgpgbtwo4 -4nine9 -twokfvsvfgdtmtwom2xlkjseven -9one43ninedrtznff -zlfive98rfpmnsevennljlhbxhcn -lmfgxfdsevenchrkbhxlrrssbcqqf7fivectglcvrsrg8 -6twofive3two -mchm6 -mbvtbcjvv33rqfsllshb diff --git a/01/1_PROBLEM.md b/01/1_PROBLEM.md deleted file mode 100644 index 711ff42..0000000 --- a/01/1_PROBLEM.md +++ /dev/null @@ -1,28 +0,0 @@ -# --- Day 1: Trebuchet?! --- - -[https://adventofcode.com/2023/day/1](https://adventofcode.com/2023/day/1) - -Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems. - -You've been doing this long enough to know that to restore snow operations, you need to check all fifty stars by December 25th. - -Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck! - -You try to ask why they can't just use a weather machine ("not powerful enough") and where they're even sending you ("the sky") and why your map looks mostly blank ("you sure ask a lot of questions") and hang on did you just say the sky ("of course, where do you think snow comes from") when you realize that the Elves are already loading you into a trebuchet ("please hold still, we need to strap you in"). - -As they're making the final adjustments, they discover that their calibration document (your puzzle input) has been amended by a very young Elf who was apparently just excited to show off her art skills. Consequently, the Elves are having trouble reading the values on the document. - -The newly-improved calibration document consists of lines of text; each line originally contained a specific calibration value that the Elves now need to recover. On each line, the calibration value can be found by combining the first digit and the last digit (in that order) to form a single two-digit number. - -For example: - -```text -1abc2 -pqr3stu8vwx -a1b2c3d4e5f -treb7uchet -``` - -In this example, the calibration values of these four lines are 12, 38, 15, and 77. Adding these together produces 142. - -Consider your entire calibration document. What is the sum of all of the calibration values? diff --git a/01/Trebuchet.Tests/GlobalUsings.cs b/01/Trebuchet.Tests/GlobalUsings.cs index 8c927eb..7fef4b0 100644 --- a/01/Trebuchet.Tests/GlobalUsings.cs +++ b/01/Trebuchet.Tests/GlobalUsings.cs @@ -1 +1,2 @@ -global using Xunit; \ No newline at end of file +global using Xunit; +global using FluentAssertions; \ No newline at end of file diff --git a/01/Trebuchet.Tests/PartOnePuzzleSolverTests.cs b/01/Trebuchet.Tests/PartOnePuzzleSolverTests.cs new file mode 100644 index 0000000..4267777 --- /dev/null +++ b/01/Trebuchet.Tests/PartOnePuzzleSolverTests.cs @@ -0,0 +1,33 @@ +namespace Trebuchet.Tests; + +public class PartOnePuzzleSolverTests +{ + private readonly PartOnePuzzleSolver _sut = new(); + + [Theory] + [InlineData("1abc2", 12)] + [InlineData("pqr3stu8vwx", 38)] + [InlineData("a1b2c3d4e5f", 15)] + [InlineData("treb7uchet", 77)] + public void GetCalibrationValue_GivenAStringContainingDigits_ItShouldReturnSumOrFirstAndLastDigit(string input, int expected) + { + var result = _sut.GetCalibrationValue(input); + result.Should().Be(expected); + } + + [Theory] + [InlineData(new string[] { "1abc2", "pqr3stu8vwx", "a1b2c3d4e5f", "treb7uchet" }, 142)] + public void SumCalibrationValues_GivenAnArrayOfStrings_ItShouldReturnTheSumOfAllCalibrationValues(string[] input, int expected) + { + var result = _sut.SumCalibrationValues(input); + result.Should().Be(expected); + } + + [Fact] + public async Task SumCalibrationValues_GivenAFile_ItShouldReturnTheSumOfAllCalibrationValues() + { + var input = await File.ReadAllLinesAsync("INPUT.txt"); + var result = _sut.SumCalibrationValues(input); + result.Should().Be(53194); + } +} \ No newline at end of file diff --git a/01/Trebuchet.Tests/PartTwoPuzzleSolverTests.cs b/01/Trebuchet.Tests/PartTwoPuzzleSolverTests.cs new file mode 100644 index 0000000..3854d4f --- /dev/null +++ b/01/Trebuchet.Tests/PartTwoPuzzleSolverTests.cs @@ -0,0 +1,41 @@ +namespace Trebuchet.Tests; + +public class PartTwoPuzzleSolverTests +{ + private readonly PartTwoPuzzleSolver _sut = new(); + + [Theory] + [InlineData("two1nine", 29)] + [InlineData("eightwothree", 83)] + [InlineData("abcone2threexyz", 13)] + [InlineData("xtwone3four", 24)] + [InlineData("4nineeightseven2", 42)] + [InlineData("zoneight234", 14)] + [InlineData("7pqrstsixteen", 76)] + [InlineData("99seven3vdcgvmvxtjtwodc5", 95)] + [InlineData("gpmfhninexxgqr6", 96)] + [InlineData("five3xjzlrmxvqznine", 59)] + [InlineData("nine4vqxmzqxcvfhlm45", 95)] + [InlineData("4nine7oneighthm", 48)] + public void GetCalibrationValue_GivenAStringContainingDigits_ItShouldReturnSumOrFirstAndLastDigit(string input, int expected) + { + var result = _sut.GetCalibrationValue(input); + result.Should().Be(expected); + } + + [Theory] + [InlineData(new string[] { "two1nine", "eightwothree", "abcone2threexyz", "xtwone3four", "4nineeightseven2", "zoneight234", "7pqrstsixteen" }, 281)] + public void SumCalibrationValues_GivenAnArrayOfStrings_ItShouldReturnTheSumOfAllCalibrationValues(string[] input, int expected) + { + var result = _sut.SumCalibrationValues(input); + result.Should().Be(expected); + } + + [Fact] + public async Task SumCalibrationValues_GivenAFile_ItShouldReturnTheSumOfAllCalibrationValues() + { + var input = await File.ReadAllLinesAsync("INPUT.txt"); + var result = _sut.SumCalibrationValues(input); + result.Should().BeLessThan(54249); + } +} \ No newline at end of file diff --git a/01/Trebuchet.Tests/Trebuchet.Tests.csproj b/01/Trebuchet.Tests/Trebuchet.Tests.csproj index c97c02e..f92e1da 100644 --- a/01/Trebuchet.Tests/Trebuchet.Tests.csproj +++ b/01/Trebuchet.Tests/Trebuchet.Tests.csproj @@ -10,6 +10,7 @@ + @@ -26,4 +27,10 @@ + + + PreserveNewest + + + diff --git a/01/Trebuchet.Tests/UnitTest1.cs b/01/Trebuchet.Tests/UnitTest1.cs deleted file mode 100644 index 610c478..0000000 --- a/01/Trebuchet.Tests/UnitTest1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Trebuchet.Tests; - -public class UnitTest1 -{ - [Fact] - public void Test1() - { - - } -} \ No newline at end of file diff --git a/01/Trebuchet/Program.cs b/01/Trebuchet/Program.cs index 3751555..d90bb99 100644 --- a/01/Trebuchet/Program.cs +++ b/01/Trebuchet/Program.cs @@ -1,2 +1,143 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using System.Text.RegularExpressions; + +namespace Trebuchet; + +public class Program +{ + public async static Task Main(string[] args) + { + if (args.Length is 0) + { + Console.WriteLine("Please provide a path to the input file."); + return 1; + } + + if (File.Exists(args[0]) is false) + { + Console.WriteLine("The provided file does not exist."); + return 2; + } + + IPuzzleSolver puzzleSolver = args.Length > 1 && args[1] == "2" + ? new PartTwoPuzzleSolver() + : new PartOnePuzzleSolver(); + + var input = await File.ReadAllLinesAsync(args[0]); + var result = puzzleSolver.SumCalibrationValues(input); + + Console.WriteLine($"The sum of all calibration values is {result}."); + + return 0; + } +} + +/// +/// Interface for puzzle solvers. +/// +public interface IPuzzleSolver +{ + /// + /// Sums all calibration values. + /// + /// The lines of the input file. + /// The sum of all calibration values. + public int SumCalibrationValues(string[] lines); + + /// + /// Gets the calibration value for a given line. + /// + /// The line to get the calibration value for. + /// The calibration value for the given line. + public int GetCalibrationValue(string line); +} + +/// +/// Puzzle solver for part one. +/// +/// +public class PartOnePuzzleSolver : IPuzzleSolver +{ + public int SumCalibrationValues(string[] lines) => lines.Sum(GetCalibrationValue); + + public int GetCalibrationValue(string line) + { + if (line.Length is 0) + { + return 0; + } + + var numbers = line + .Where(char.IsDigit) + .Select(char.ToString) + .ToList(); + + var firstNumber = numbers.First(); + var lastNumber = numbers.Last(); + + return int.Parse(firstNumber + lastNumber); + } +} + +/// +/// Puzzle solver for part two. +/// +/// +public class PartTwoPuzzleSolver : IPuzzleSolver +{ + private readonly Dictionary _validDigitsAsWords = new() { + { "one", "1" }, + { "two", "2" }, + { "three", "3" }, + { "four", "4" }, + { "five", "5" }, + { "six", "6" }, + { "seven", "7" }, + { "eight", "8" }, + { "nine", "9" }, + }; + + private bool HasValidDigitAsWord(string word, out string match) + { + var matchResult = Regex.Match(word, _validDigitsAsWords.Keys.Aggregate((a, b) => @$"{a}|{b}")); + match = matchResult.Value; + return matchResult.Success; + } + + public int SumCalibrationValues(string[] lines) => lines.Sum(GetCalibrationValue); + + public int GetCalibrationValue(string line) + { + if (line.Length is 0) + { + return 0; + } + + var currentWord = string.Empty; + var numbers = new List(); + + foreach (var character in line) + { + currentWord += character; + + if (char.IsDigit(character)) + { + numbers.Add(character.ToString()); + currentWord = string.Empty; + } + + if (HasValidDigitAsWord(currentWord, out var match)) + { + // The last character of the match could be the + // first character of the next valid digit as word + // so we want to preserve it for the next iteration. + numbers.Add(_validDigitsAsWords[match]); + currentWord = currentWord.Replace(match[..^1], string.Empty); + } + } + + var firstNumber = numbers.First(); + var lastNumber = numbers.Last(); + + return int.Parse(firstNumber + lastNumber); + } +} \ No newline at end of file diff --git a/01/Trebuchet/Trebuchet.csproj b/01/Trebuchet/Trebuchet.csproj index 2150e37..238dbed 100644 --- a/01/Trebuchet/Trebuchet.csproj +++ b/01/Trebuchet/Trebuchet.csproj @@ -6,5 +6,4 @@ enable enable -