Added day3 solves
This commit is contained in:
parent
35a8a47a84
commit
9cce383da7
3 changed files with 53 additions and 0 deletions
7
day3/input.txt
Normal file
7
day3/input.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
^<when()]'>mul(721,815)who()&[how()mul(990,467)select()<mul(252,360)}mul(733,661)?>why();what(327,762)?@mul(636,928),[!#$??:+do()where()@%>@&],<}mul(766,598)mul(117,278)where()$mul(469,793)[~]where()mul(884,216)mul(795,723){what()mul(184,793)when()!*&mul(87,768)(mul(436,871)>>?::why(645,65)~/why()why()mul(761,50)'&-: &;mul(450,66)>what()-how(244,505)}mul(737,574)$where()who()!select()mul(828,224) %/((mul(612,706)[mul(56,369)<+when(871,669)+when()/^#when()]mul(33,835)when()$what()from()'when(575,599)mul(98,444)(&<from()who()mul(830,449)where()*}where()-'who()mul(933,646)'mul(296,404)select()]mul(799,997)mul(748,99)({}(when(203,995)#:+mul(124,120))mul(681,114) mul(607,559)'[?[</what()<who()when()mul(177,309)}select()>from(399,328)]mul(149,861)%who()mul(493,109)+#(how()!$}-where() mul(992,42)when()>mul(966,422) {mul(128,242){$,when()-what()from()who()<mul(466,707)where()]where()*select(183,299)$from():where(),mul(834,265)}: '[<what()[mul(738,669)+@-?from()<-;mul(253,934)#!!'}(![why()mul(704,145)who()<why():[@mul(107,760)%!,#(>where()/&what()mul(111,554)-+don't()}}/(^(&+mul(130,716)[+<why()select()who()^mul(326,975)~mul(235,464)mul(635,515)/mul(954,178)*what()^]!+<(do()<;where(),[$who()!mul(762,678)~,,-+}+>!/mul(585,272){how()/:who()who()where()mul(638,890)><!!%select()@{!mul(568,705)when(576,297):%where()$/$/}mul(586,693)(**mul(859,687)from()~$$?$!who()(mul(507,491);+mul(993,776)'mul(746,47)<<mul(255,820)^@from()(?>mul(892,569) -/;mul(365,771)mul(703,962)mul(891,916)!why()[{:!why()!mul(85,405)^?$what()where()where()~<do()+&+'why()from()}]<mul(536,49)($from()what()when()mul(455,408)why()(-)+}*-~who()mul(452,399)from()@mul(85,830)@-)mul(734,9)[<!;@*select(){do()why()how()^*<~^where(){mul(986,194)!']^!mul(659,964)<-[>,(select():when()mul(102,589)who()]#when()^do()$when()+*mul(433,264)!%where() mul(676,814){who()mul(791,825)?mul(69,953)}mul(348,556)##how()what()who(){[>?how(151,194)mul(346,158)mul(698,833)>(:mul(249,39)!{<{//~when(){mul(686,621)what()mul(516,43)*who()mul(326,716)select()do()^#$/&mul(692,750)when()&[?->{mul(218,8)&&mulwho() $where()}{}#mul(820,744)/mul(230,927)^ :where(351,105)~/(;mul(900,172)$]{?$#where()mul(652,481)<}don't()*where()select(200,394)select()#who()mul(650,602):}when(552,753)-when()how()'mul(349,401),&how(){'mul(989,165)%$* ,,&mul(906,532)mul(701,543)when():?#what()~+how()mul(113,743)[$;select()!how()mul(68who()mul(153,928)%()^[from()mul(555,552)@select(522,482)mul(295,900)where()/mul(189,189)+'&mul(490,144)++/<mul(252,195)&<<mul(274,206)where()};: why()do()[mul(995,775)~[%&*mul(119,442)(why()what()&)from()%why()where()mul(278,384),mul(2?>&from():why()+*do()how()<?mul(635,799)];>[~when(612,413)-when()?do()}who()mul@/why() {?-%%mul(126,29)@+from();mul(548,673)mul(51,970)--}what()~,what()(mul(261,780)@;'why()>;what()mul(843,665)when();@mul(575,431)]:;>{#mul(123,103);]where()<why()?do()/]<?how(484,347)!-,&mul(513,533)mul(427,500)!:mul(649,325)$'~}'((don't()}!select()+%mul(166,962)how()#why()@/$[>where() mul(331,417)?+select()}when()mul(730,923what()who(514,796)where(716,633);when());why(122,722)(mul(923,885)where()''#'where(645,705)}#select()!don't()where(),,;!}&^mul(609-<why()!@)how()!^ mul(367,932)]@how()**when();;do() @$why()[*what()mul(365,75)?<} what()~~!mul(392,384)-$>'(mul(245,580):mul(898,814)how()+mul(999,143)),select()mul(251,507)(%<:who()why()how()/%mul(192,864)
|
||||
*,/~):^[mul(802,939~;!:@mul(656,831)}]?~mul(92,389)/:who()&why()'mul(698,92):who()]/< @@@mul(956,581)who(252,379),#&,%mul(315,398)mul(518,43)@, &/[* mul(344,100)how();mul(826,831)<when()(>when()select()++'mul(175,965) [ mul(786,297)from()how(520,671):*?]&%]mul(647,834)why()when()select()/mul(585,934)!@<&how()!/mul(965,795)!,@/how())(#{mul(701,685) mul(51,440)/)mul(382,190)@why()how()>>#+;%{mul(808,654)#*mul(128,793)%:->mul(397,504)];$]from()mulselect(533,968))>why();^mul(661,310)mul(415,957)}?&%#@(mul(261,4)*;mul(292,885)!mul(639,791)from()how()when()mul(451,10)mul(853,231)+~+']>mul(543,437)mul(218,441) *mul(447,927)why()from()mul(178,473)how()<*why()[&how()how(),mul(139,541)>~why(644,46) who()what()+~(mul(888,667)^from()&^when()^when()-where():mul(585,185)>from())]+mul(766,787)mul(16,587)%@mul(475,198){<who()select() #-{}]mul(961,363)~%mul(851,371)-(who():$what():>^mul(353,741)&~]$<;]:mul(529,533)where()~mul(980,696)how()when()/*>when()#^don't()![]#[*%-mul(315,512/when(57,948)?why()mul(107,632)%>&who()[mul(554,91):from()!who()?how()why()%#when(313,134)don't()mul(694,300)/~(,+who(382,968)}from()mul(69,889)')why(768,374)+how()mul(338,324)$select()}] select()mul(572,647):from()mul(12,530)mul(651,890)mul~@?mul(841,284)]%^where()mul(201,525)where()(do()&@}]how()<^who()]&mul(166,168)>;mul(419,733)!mul(197,692)select()+>-@'&{who()mul(936,290)select()/when()#(/when()mul(201,918)~,how()>&[@<}'mul(400,452)<&[[%^select(131,478)$where()^mul(31,294)@{who()mul(275,538)^]@;}]&^mul(362,151)~mul(840,788(,/;&why()^[[don't()mul(615,413)where()$mul(404,421)select()@,when()~+%}$mul(157,970)$mul(846,324)what()mul(449,574)-mul(517,831)* +when(478,401)?]mul(991,421)@%mul%select()%who()mul(970,585),&[?/'?~:/mul(831,536)^]how()>mul(577,864)^$+mul(391,353)who()what()@${mul(144,420)])why()* !:mul(595,206),select();<how()(mul(144,67)when()mul(330,108;@select()-%who())mul(682,352)>when()-)mul(723,270)+!*~^]where()mul(629,243)how()(mul(651,134)'')$)why():'$mul(488,642)mul(975:#from()^?%mul(663,263)#+!(from()/;why()(mul(4,649)mul(520,137)*'>mul[?where()-:%;mul(647,34):-what()why()select()-mul(549,57)}mul(917,540)where()?why()when()why()why()/$!select()mul(938,743{mul(61,74)+@mul(405,137)$who()mul(937,685]'^mul(965,910)}what(838,413)mul(975,550){}+?++<'mul(928,26how(128,389)'?>#who()<-select()do()%[how()]select()@<what(24,696)^mul(801,670)mul(957,90)when(608,20)where()&{[select()when()where()(mul(420,232)#)>[ >/ mul(114from()}*what():when()#when();mul(613,512)where()[~~;@(how()^mul(46:where()($mul(773,236)^*from(101,73)$mul(127,952)):?,:<-mul(12,239)mul(683,676)how()/[#mul(650,459)#;'mul(252,579)?from()@[do()mulwhere()]!,->$]~>mul(657,580)select()$>+;when()>mul(983,621)*from()}how()/]#!<{mul(135,869)!@:what()select()}#mul(947,363)mul(267,51)#mul(178,200)mul(131,552)^(why()mul$-+/~-~-^[who()mul(763,94)&(]% ~^/>mul(820,422)&,select()%: !mul(27,886)select()what()+/}^@what(),mul(704,766)*[why()why()mul(358,218)-&>when()mul(432,681)?% ?mul(502,580)]{::'*!]mul(237,998)how()++where()who()from()what()/mul(897,575)how()how()+?&>}mul(696,285)select()] {/(+mul(340,384);mul(164^from()-%~{mul(283,522)&+'%~- )}where()mul(237,601){! ~<mul(505,931)(<mul(69,179))how()(who()%mul(562,715), why(183,43)select()why()where()where()}mul(152,338)-! mul(883,226)who()+{$,do()!;@*^- mul(889,345)
|
||||
#mul(582,654)<&&(%+when(526,400)who()!mul(592,845)'mul(223,737)$#select():from())mul(68,348)who()mul)mul(171,69)who()?;when()#/>mul(19,553)/(#,when()-from()from()!mul(933,578):(@#^from()#>*mul(296,919)from()what()-mul(239,343)~$when()mul(184,945)&!?&+!#when()why()/mul(814,466)@how()where():why()what()%/mul(498$!where()mul(121,233)+<)~select(89,323):;}where()why()mul(293,662)[from()mul~}mul(96,122))when()who()who() ':(<mul(418,555)what(269,422)%!why()]why()-&mul(798,633)#who(128,985)+'+why()[who()do()]mul(469,404)'where()when()from()}from()<mul(111,572);when()@how()mul(161,866)*what()how()@;+/#!mul(230,417)where(){select()~/@what()*;mul(33,798)[what()/>}how()#mul(303,846)+&^%;]select()!why()mul(856,3)$'where()how(),mul(985,407)~mul(75,217)>%@({@don't()how()mul(601,409)]$-}[^@&don't()@>from()mul(313,975)!$when()-;<~+~mul(273,261)[-(mul(849,769)*select()how(480,586)from():+)mul(263,796)%what()why():!{mul(732,962)@mul(541,715)who()</?')^^mul(515,460)^#^~,&@~what(211,792)don't()mul(838,339)from()>:)++-?~select()mul(272,709),%how()&from()where()mul(128,863)-%>mul(66,521);what(),&~@}+:{mul(683,867)^mul(967,554)</select()&how()#$mul(942*mul(943,745)mul(49,774)<}/~}?}<*~mul(122,334)/^from()what(385,735)/'from()~select()[mul(267,146)mul(557,279)[how()$mul(795,502)what()why()mul(422,804)select())(,&!'<+mul(770,454)<mul(347,611@}~where()#^()%'{mul(646,464)mul(360,722)-}):,what(387,646)select()'&where()don't()why()where()mul(280,279)!,{@{![@[mul(275,890)mul(588,483)why(){<why() ;mul(812#do()-$mul(868,147),!}<*how()mul(176,577)how()how()mul(299,254)&[why()mul(106,255)how()<<]select()]]{mul(61,684)&where()^when()?where(63,148)mul(604,419)~]^from()mul(171,532)/why()mul(431,695);%,what(),,mul(256,206)who()[>)+(mul(163,187<:}; where(149,753),-!mul(454,102)]from(581,325)^>^how()?select()~'mul(612,695)>$~;?from(335,390)>;<(mul(158,809)mul(994,415)why()^who()('mul(906,133)[:mul(454,783)select()}/ mul(496,587)&$[)]<*<^%mul(916,337) *where()(,}from()%mul(781,945))^select();why())mul(966,406)!$+(why()}<^mul(118,864)/how()mul(946,437)#{mul(723,269)%*&*^when()$mul(337,544)*-select()!when())]what()[$mul(624,678)&;who()what()how()$@mul(41,821)mul(860,521)&-why()from())@^where()'mul(627,836)?>;?,$mul(862,746)when()from()&~$who()select(171,606)mul(325,203)?from(569,805)<mul(655,515)]mul(155,237)do()&mul(194,966)!$;}--mul(583,204)){^(**@)?mul(752,887)>what()%select()]mul(316,107)?~&&from();^<?^mul(710,748) when()what();'mul(294,295)where()}mul(842,104) from()mul(155,230)where()mul(946,267)]what()^>}&<mul(464,187)%what()how()%who()$[}mul(353,188)how()when()>when()#mul(229,118)what()what()why()-* +%;mul(635,909)mul(965,642)^mul(942select()]{mul(793,836)@/+why()*>/(mul(453,491)>'^where(){select()select()%mul(628,54)*>]?select()$who();mul(508,795)}%!%>mul(823,280)from()%mul(247,633):mul(779,419)/#^*<}?mul(921,457)where() -where(439,307)?+/how()+(mul(231,858) :mul(205,634):[how()?-'^<'mul(160,480)%!)(what()why()^^~,mul(276,727)when()^[ ##select()mul(382,146)where()when():?^[]%-mul(976,132how()^-&how():-)!#/mul(25,564)!(when(464,814)how()when(440,219)who()[~where()mul(956,412))<select()):mul(382,255)when()$'mul-do()*(}mul(652:~$$:where()mul(878,198)''%!who(){do() ]mul(209,22)where()^'why(190,127)where()where()what()+)mul{+select()why()mul(805,74)who()[)^)where()from()!@{mul(428,488) $,'mul(242,86) &,)do()mul(622,801)[mul(267,546))how()!where();how()select()from()<mul(988,89)>]@select()who()$~']'mul(507,562)&}> mulhow()$/ &&,(<-}#!/usr/bin/perl^when():{+^('how()^mul(452,533)@where()?$mul(442,913)how(){]from()select()$how()select()from(),mul(484,240)
|
||||
&mul(444,854)when()mul(774,478)where()&&^ mul(922,900)how()how()]+{what() mul(606,127)from()]what(){[what()mul(721,275)mul(235,360)(%'what()*)mul(572,460)'mul(48,7)who()],where()from()>>mul(593,878)where()%<>&mul(820,458)from()&select(271,971)!do()where():>-mul(355,304)from()(;why();[select()}mul(805,242)+![select();mul(775,789)~mul(628,350)$$from()@(*<mul(242,513) mul(701,110)%*] from()mul(984,986)}select()select()when()why():?<*mul(329,623)mul(179,244)?mul(674,100)*why()?$ >how(){'mul(960,498)why()<>select(440,141)(mul(670,865),>what()+::mul(208,606)mul(329,619)$don't()^from()-where(651,585)how();,how(753,435)>'mul(198,179)~mul(687,19)#->/do()+%$]^mul(36,106)%where()who();)mul(146,12)^/-mul(957$mul(722,483)(^where()mul(791,915)&+^who()!do()}>'%:^:mul(419,941)/don't(){when()+when()~*(^mul(595,305)from()why(),/how()where()]}mul(819;^&what() ]-where()&who()>mul(335,130)what()]where()[/where()what()?;mul(193,281)~,who():+why()mul(346,672)){@do();^>select(629,407)where(){^/!'mul(523,137)]&select()$/?/^mul(757,373)don't();when(648,805)mul(937,925)where()mul(52,179)?*&}>;mul(820,72)from()mul/}from();&!when()what()mul(341,113)%when(),/+@@mul(282,840)%what(845,759)?/%?who(38,906)mul(790,88)select()when()(-}&select()/mul(460,748)}#why()how()^}($from()mul(736,446)#$/don't()@*:<$mul(647,695) where():where()who(){mul(124,189)}:~@mul(567,682)from()''mul(537,138)mul(126,676)>why(){how()/;select()what()mul(211,918)]@*%where()<;;!mul(367,207)',?mul(699,852)what()>,)~mul(223,597)+what()how(556,77)+don't()/@/:[{-mul(610,646)(why()who()how()*}mul(388,590):why()!mul(777,494)[who()+mul(332,45)!:when()mul(107,845)who()(]from()select()mul(518,311){*mul(75,698)(/!~#@$where()!,mul(55,490) :{where()mul(681,43)}~>]--^:$]mul(55,980){;mul(443,44)@mul(750,251)from()$$&#when()>mul(979who()!how()mul(504,318)mul(402,389)[!#@why(525,210)+mul(984,318)when()how()}%/mul(221,803){who()how()~$mul(88,963)>}$&from()where()+]from()%mul(38,316),mul(207,135)who()what()what()+&mul(627,85)]: &?why()?*--mul(79,741)+(?~%!!mul(51,132)where()@where(994,962)mul(691,851)from()+why(): {[mul(543,495&<mul(848,581)from()~mul(264,590)/from()@&#what()what()mul(711,120)who();*)how()who()mul(787,646);/(}why()--]select()*mul(845,59)<mul(783,352)mul(551,759) %-~mul+(when()@~mul(193,897)mul(659,173):-mul(61,698)?*mul(522,371*why(260,477)when()-?)mul(824,502)]}]%+~mul(666,514);mul(208,347)mul(980,919):{;;how()$~mul(307,313)select(){%~[where();mul{ why(434,341)select()}!don't()>#how(){(;how()['mul(352,179)/)+ /~mul(250,222)<select():@%^mul(475,860)mul(364,725)>^+<} mul(719,257)%from()why():^?!^[don't()(,where()$mul(894,942)how()!(where()$mul(506,810) from()}%@)**mul(261,233)mul(179,77)>$mul(248&why()%where())+%}<,who()mul(920,816);mul(384,108>mul(954,663)mul(11,936)who()&%{:mul(698,682)who()select(903,689)who()from()-where()/+mul(332,753) where(){?how(52,910) )(what()mul(580,139)[[~,('mul(762,762)from()~}- ~*^[mul(348,345)%*mul(776,555)how()/when()-!&:+mul(354,880)when()%<>;mul(121,687)-#:]when()why()/::mulwhere()from()mul(353,738)@&}#don't()mul(888,259):{[ +*<from()%when()mul(852,318)select();/(mul(88,561)?why()select()@mul(132,54)where(617,46)*select()+}#mul(385,930),when(130,526);:mul(510how()'mul(889,914)$,+]$$'mul{:from()[who()'mul(68,843)how()mul(507,589):;+,from()(-how()mul(459,293)}{%when()mul(113,241#[]+mul(205,452)]%@:mul(818,114)(?(%]when();^mul(657,405)
|
||||
-where()where()->mul(457,716){from()<!]^%')select()mul(441,310!&'{-<%mul(574,11)&mul(591,262)why()~[{[from())mul(716,62)&{when()select()::/mul(653,828)#,when(554,764)>mul(784,718)::^mul(34,955),from()select(545,368)%!]?/mul(795,164)-?)why()how()'%'[who()mul(754,424)from()-select()from()^mul(772,122)where()where()where()select()?where()%-mul(849,64)what()!$'&++mul(557,560)!? :]select()(mul(824,973)>;?{(mul(333,526)why(),mul(814,560{from()#mul(860,603)what()]{where()select()mul(209,175);when()>where()mul(242,542) [[mul(563,973)-mul-&$;)~why()$%why()mul(443,590)?[<;when()don't()what()where()}where()what()mul(178when()from()where()where(244,944)mul(674,125)'mul(709,133)'<):?&why()<mul(974,750))when()how())[/who()who()why()how()mul(329,218)<$when()$ who() -when()when()mul(382,520)?where()}from()'mul(235,982)mul(114,382)mul(217,835)]*^select()/)^mul(421when() *&select()@[where()mul(816,560)select(){&who())!</do() from()&/:$[]<mul(308,409)]{%how(619,906));mul(266,954)what()''^+'%%}what()mul(343,656)$^}~mul(470,30));what();where(461,603)%%-mulwhen()?how(4,237)[mul(904,717)/why()select()>&>%+,mul) , !-mul(160,387)~&^mul(725,120)who()[]mul(512,611)select()/?mul(617,372)select()>who()[(mul(802,268)-)*&:mul(815,27)]what() )#-,%<&mul(429,97)}!&mul(106,545){~: when()+<mul(783,617)?@*?+mul(54,536)*'?![(mul(28,300)[-^-%~} select()%mul(924,216)don't()#when()+mul(439,873)) $]mul(979,133){*@when()~mul(494,759)}<$+/+~what()~mul(787,884)mul(305,20):@what()/&select();}&select()mul(925*~,%what()/?}mul(694,535)*mul(599,427)what()who()^?&>,mul(438,161/>--<where()++~ who()mul(812,18)from()?~!+mul(503,754)where() mul(503,55)why()mul(775,794)when(787,226){-(mul(807,160)how()'mul(500,952)*who()&'*' ^mul(819,54)from()<<%[from()&don't()%+mul(678,212)@}mul(32,180)mul(141,345)#&how()select()what()mul(337,406)?from()@when()&}};/don't()when()$why()mul(845,651)>mul(818,804)<))don't()[>mul(602,506)mul(55,393)*[:mul(157,531)^don't()?{+mul(554,938)*;mul(385,567:who()>how()&+?*mul(574,353)mul(984,83)-how()-mul(872,273)((mul(517,792)?select()why()^mul(730,625){{'mul(83,516)when()((mul(130,817):mul(519,651)]&/why()!mul(836,209)[%,[mul(213,670) )what()>;@!mul(611,517)>]mul(197,385)@mul(68,987)mul(162,106):when(7,896):mul(796,638)>^!/'>mul(845,941)/where()do()#:what()what()?~&?mul(806,128)]%why()mul(348,883),'+mul(336,235): 'how()mul(855,266)@$^why()mul(742,387)who()!mul(995,906):]]when()<)*from()(&mul(764,180)~how()@# :mul(707,290)#/{@mul(65,579)-who()where(960,596)>*(don't()from(766,430)where()mul(75,404)(when(457,596)#&mul(612,799)#)where()mul(401,474)what()%where()#>+mul(31,289)&>)?/(-mul(189,149)>~,when():mul(985,763)$&who()#%!mul(804,329)>'mul(229,945) don't()who()who(84,291)*select()why(),;,?mul(470,948)from(681,767):*who()&%mul(850,581)what()>(#}%}mul(636%mul(641,599)mul(184,164)mul(575,439);({{mul(738^--^)%mul(60,730)where()^]from()who()-/:what(848,902)mul(958,89)},where(148,634)-mul(371,786)when()?mul(151,757)select(973,278)!)select()]'who(130,338)):mul(644,833)mul(480,246)what()mul(305,497)^mul(233,355),}who(563,221)>who()where()/when()'mul(412,498^how()-$?what()&[select()mul(179,439)&where()^{#[%mul(510,163)when()where(353,632)':mul(629,922)+%}:+how();@how(103,365)}mul(961,420)~select()*~:#mul(914,166)<don't()who()^!@ mul(724,797)&when()(^('mul(797,538~from()$(do()(%$/,$%who() mul(301,788)-/where()}'@[:}mul'mul(474,181) mul(204,444){,from()from()+/(%}mul(49,941)
|
||||
>who()/!why()mul(392,362){<@what(){from()select()why(917,470);why()mul(217,122)~}what()where()$(}mul(422,535)(*how()}&mul(777,997)&[where()]mul(664,558)!/+)*{ why()mul(308,60)~[*how()what(){,!from()where()mul(234,662)*)+who() who(){]{mul(638,389)select()$%;}~how()who()mul(223,862):what()mul(150,399)mul(566,885)mul(231,725)[/mul(230,942)')-:)who()'{where()^mul(400,853)why()@[from()where()&[@<^mul(325,706)+-{mul(115,2)&&?*{mul(954,823);what()mul(600,695)when()how()when()*;:[-mul(78,362)#select()/$(>select()$^mul(981,64)>mul(899,724)what()}who()mul(94,857)@$&<:)mul(142,322)&&;/?*who()?where(315,764)mul(169,174)&/%('mul(340,253);@)[select(607,401))select()mul(683,991)&:how()select()[<#how()mul(186,106){>!(<do(){]who()'how() mul(359,361)>*mul(490,980)(]))from()]where(84,603)mul(342,395what(){)&];why()who()what()[%mul(751,371)who(720,254) why()when()<why(261,166)mul(324,33)when(100,997)select()do()$:'who(808,641)],mul(255,881)when()mul(846,72)]where()[what()/when()what()mul(786,445)$from()&#<),do()'%who()/^:?mul(298,319):mul(899,483how()mul(238,137)^]/$;mul(282,399)mul(485,433)~who(117,520);where()do()mul(111,581)(:>what()}select(455,617)'mul(53,661),:/>:!mul(446,454-?what():$[[+mul(498,205)>(mul(759,494)mul&>?:^'} mul(867,709)mul(605,504)what()[-!}!mul(106?>mul(239,94)+>where()#+! mul(618,663)&--':%mul(57,203)/![:,$select()mul(614,15)^]mul(570,897)what())?who(812,559)<who()~mul(356,480)(,-/} %mul(626,318)who()&mul(931,605)>/*don't()}mul(150,813)&+what()]~!+mul(999,729)[mul(110,688)>:select()@>select()/,who()}mul(22,21)how()~^- $+#from() mul(45,829)don't()([why()+-:>mul(488,321)&*-mul(652,853)>when()^ how()where()select()*mul(468,965)++mul(781,52)why()>+~^}]mul(268,658) ::where()>'mul(233,327):select()?}mul(269,680)/{+>@:(select()$how()mul(322,587)/;mul(406,648):*who()/mul(53,8)don't()::mul(340,161)/?>/&don't()select()*>mul(315,698)]who())how()[,how()how()}mul(987,159)&!mul(979,457)~[-where()#mul(381,476){from(261,299)from()};^,where()from()?mul(681,344)*+when()why()@;(#&don't()~ ,select()where()mul(239,813)!mul(808,143)what()(>select()!what()what()!,mul(494,477)do()select()how()-+where()from()what()!mul(797,39)>}}}+[(^why()how()mul(393,474);{mul(159,285)!how()[}mul(936,615)]mul(311,234):>)why()!mul(70,105),[]mul(143,155)?who()/ +(when()select()~mul(225,35)/^!mul(637,97)~!&*#+<$mul(886,753)what()!]what()(mul(513,884)~how()-+]mul(906,496)+!&where(){>' ;when()mul(302,264)@!~/where()?what()$do()>$who(391,417)what(106,572)mul(97,315)'-mul(211,823)},/mul(460,903)!;#{ }~'mul(264,775)mul(913,491)-when()~%[how()/}?%mul(482,242)@+<:from()$'don't()~;mul(396,591){from():where()]~mul(525,827)when()#why()from() #%*<mul(292,8):!mul(148,504)}'who()*'mul(266,240)@:%who()>who()mul(407,541)*mul(484,568)mul(62,785) what()@what()when()mul(908,348)%>]how()mul(531,232)]<why()mul(949,96)[&~/;(*how()mul(487,341)how()how()'who():!?^[mul(393,246)*when(522,626)mul(782,560)$what()select()~'#from()mul(29,363)# +{>how(827,75)>-don't() <why(372,174)mul(531,413)<%)when()&?<)mul(556,841)@!{%'where()@mul(894,706)'$]]~who()how()mul(852,340)>??++mul(7,189)#do()who()mul(661,112);who()'--;mul(793,568)who()select()-~{mul(937,614)mul(775,294)<'when()~^;+mul(140,643))+<#'
|
||||
|
23
day3/solution.py
Normal file
23
day3/solution.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import re
|
||||
|
||||
example = """xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))"""
|
||||
input = open('input.txt').read()
|
||||
|
||||
def solve(input) -> bool:
|
||||
find_all = re.findall(r"mul\(\d{1,3},\d{1,3}\)", input)
|
||||
|
||||
print(find_all)
|
||||
|
||||
total = 0
|
||||
for find in find_all:
|
||||
a = find.replace("mul(", "")
|
||||
b = a.replace(")", "")
|
||||
c = b.split(",")
|
||||
|
||||
result = int(c[0])*int(c[1])
|
||||
total += result
|
||||
return total
|
||||
|
||||
|
||||
print(input)
|
||||
print(f"Total: {solve(input)}")
|
23
day3/solution2.py
Normal file
23
day3/solution2.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import re
|
||||
|
||||
example = """xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))"""
|
||||
input = open('input.txt').read()
|
||||
|
||||
def process_instructions(text):
|
||||
mul_enabled = True
|
||||
total_sum = 0
|
||||
|
||||
pattern = re.compile(r"(mul\((\d+),(\d+)\))|do\(\)|don't\(\)")
|
||||
for match in pattern.finditer(text):
|
||||
if match.group(1):
|
||||
if mul_enabled:
|
||||
num1 = int(match.group(2))
|
||||
num2 = int(match.group(3))
|
||||
total_sum += num1 * num2
|
||||
elif match.group(0) == 'do()':
|
||||
mul_enabled = True
|
||||
elif match.group(0) == "don't()":
|
||||
mul_enabled = False
|
||||
|
||||
return total_sum
|
||||
print(process_instructions(input))
|
Loading…
Reference in a new issue