diff --git a/README.md b/README.md
index 29d3c56..745a3c2 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@ This repository contains solutions and a local development environment for the [
- Day 1: Historian Hysteria [[link]](/src/2024/2024-12-01/README.md)
- Day 2: Red-Nosed Reports [[link]](/src/2024/2024-12-02/README.md)
+- Day 3: Mull It Over [[link]](/src/2024/2024-12-03/README.md)
diff --git a/src/2024/2024-12-02/sample.test.ts b/src/2024/2024-12-02/sample.test.ts
index 4a10bf4..1f18cb7 100644
--- a/src/2024/2024-12-02/sample.test.ts
+++ b/src/2024/2024-12-02/sample.test.ts
@@ -11,7 +11,6 @@ export const data: number[][] = `7 6 4 2 1
.split('\n')
.map(row => row.split(' ').map(Number))
-
test('countSafeReports - demo', () => {
expect(countSafeReports(data)).toBe(2)
})
diff --git a/src/2024/2024-12-03/README.md b/src/2024/2024-12-03/README.md
new file mode 100644
index 0000000..92d57e0
--- /dev/null
+++ b/src/2024/2024-12-03/README.md
@@ -0,0 +1,57 @@
+## Day 3: Mull It Over
+
+**Source:** https://adventofcode.com/2024/day/3
+**Status:** On-Going
+
+### 📘 Part 1
+
+"Our computers are having issues, so I have no idea if we have any Chief Historians in stock! You're welcome to check the warehouse, though," says the mildly flustered shopkeeper at the North Pole Toboggan Rental Shop. The Historians head out to take a look.
+
+The shopkeeper turns to you. "Any chance you can see why our computers are having issues again?"
+
+The computer appears to be trying to run a program, but its memory (your puzzle input) is corrupted. All of the instructions have been jumbled up!
+
+It seems like the goal of the program is just to multiply some numbers. It does that with instructions like `mul(X,Y)`, where `X` and `Y` are each 1-3 digit numbers. For instance, `mul(44,46)` multiplies `44` by `46` to get a result of `2024`. Similarly, `mul(123,4)` would multiply `123` by `4`.
+
+However, because the program's memory has been corrupted, there are also many invalid characters that should be ignored, even if they look like part of a mul instruction. Sequences like `mul(4*, mul(6,9!, ?(12,34)`, or `mul ( 2 , 4 )` do nothing.
+
+For example, consider the following section of corrupted memory:
+
+```text
+xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))
+```
+
+Only the four highlighted sections are real mul instructions. Adding up the result of each instruction produces `161 (2*4 + 5*5 + 11*8 + 8*5)`.
+
+Scan the corrupted memory for uncorrupted mul instructions. What do you get if you add up all of the results of the multiplications?
+
+> [!TIP]
+> **Your puzzle answer was** 187194524.
+
+---
+
+### 📗 Part 2
+
+As you scan through the corrupted memory, you notice that some of the conditional statements are also still intact. If you handle some of the uncorrupted conditional statements in the program, you might be able to get an even more accurate result.
+
+There are two new instructions you'll need to handle:
+
+- The `do()` instruction enables future mul instructions.
+- The `don't()` instruction disables future mul instructions.
+
+Only the most recent `do()` or `don't()` instruction applies. At the beginning of the program, mul instructions are enabled.
+
+For example:
+
+```text
+xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))
+```
+
+This corrupted memory is similar to the example from before, but this time the `mul(5,5)` and `mul(11,8)` instructions are disabled because there is a don't() instruction before them. The other mul instructions function normally, including the one at the end that gets re-enabled by a do() instruction.
+
+This time, the sum of the results is `48 (2*4 + 8*5)`.
+
+Handle the new instructions; what do you get if you add up all of the results of just the enabled multiplications?
+
+> [!TIP]
+> **Your puzzle answer was** 127092535.
diff --git a/src/2024/2024-12-03/input.txt b/src/2024/2024-12-03/input.txt
new file mode 100644
index 0000000..572f758
--- /dev/null
+++ b/src/2024/2024-12-03/input.txt
@@ -0,0 +1,6 @@
+<,:[*where()%mul(53,612)!^}&mul(3,518)??$~select()>??]mul(245,515),why()who()*@from()(where(242,190)mul(817,764)^select(),+who(851,301)where())from(){;mul(431,780)mul(110,982)what()what()]mul(441,829)??where()mul(269,112)>when()?who()$**#!@mul(343,569),;what()from(){(;}mul(486,404)why()]#~when()%@do()+:'why(256,886)why()who(868,710)mul(103,406)?>mul(563,652)from()$-@when())!@:from()mul(744,992)[<^~}mul(822,789)],+select(45,52)!,why()*mul(433,911) }why()<&&how()who()?]mul(877,899);':what())#{]@mul(401,705)@&mul(627,54)? )~+mul(668,930)%)}do()what()#from()$/when()[:when() mul(545,444)how()]mul(409,150)>?%?@mul(295,205))'mul(321,875)mul(915,728){?when()what(644,532)*?;<):(:mul(566,595)%'mul(499,468)/'where()}mul(721,340)]when()mul(162,291)mul(73,373)<]where()mul(100,385)][what()]mul(832,226)mul(675,546)who()how()#<^+how()'mul(119,723)what(){+,-mul(959,612)select()mul(758,905)!mul(247,521)&}$?don't()!'$ what()where(353,94)select(){mul(997,311)@from()/mul(987,583)&select(207,730)mul(299,379)select()do()what()select()when()select()]*?(?mul(841,179)!when()what()where()@:why()'>]mul(265,944)mul(968,747)what()}),(mul(541,36)~how()~select()where()when()-+when()mul(448,567)select()where()why(342,599) -when()<}mul(566,357)/$*>> mul(414,962)mul(904,116)what():/'@--}where()mul(390,663)who()~~],when()&where()[%mul(304,146))'who()>+when(){mul(526,627)!;(]@}where()where()mul(253,767)-^+]how()>,,!do():~[^when()]mul(263,450)mul(757,944)><' (],mul(934,282)@{who()+%when()mul(136,652)mul(366,573)!$//where()mul(501,845)}+~select()+]mul(532,462),~},from()mul(322,350)@~mul(64,374)&what()>[){mul(962,241),?/}-'+mul(39,522)%!$do()^}mul(447,40)mul(971,488)()mul(983,842)where()/mul(956,799);*+)^mul(233,820)mul(957,287)&>[when()why()where(855,333)<@)mul(304,558){~from(),how(){mul(555,718)]]-where() mul(881,781);^&);mul(231,766)$)mul(7,979)^why()'/,mul(352,951)mul(575,449)'mul(803/#(<^when()>mul(500,697)]~^<>[select();^when()mul(822,422)@[where()what() how()&;[(mul(756,744)how() @mul(741,854)what()(do()&how()){what()'^}-mul(664,580)<+ &+mul(788,961) -&}#!,how()who()mul(378,886)[!{,mul(53,236)what())select():~>why()~@who()mul(275,625)*from():what(80,711)why()@don't()mul(426,724)?&from()-)/^-mul(47,60)&+select()?%why()&where()mul(706,388)from()/how()mul(2,761)mul(377,995),from()*?{how()mul(198,840)why()&';[/+^~mul(72,849)mul(720,901 <(mul(998,859)mul(409,24)>?#-)why()mul(208,800)~how()+^?why()^mul(765,394) )mul(269,340)>mul:$~&select();mul(466,453)why()mul(59what()-?'where()?;who()mul(474,555)<[]]when()%-how(225,412)mul(626,574)/,{{what(832,679)where()how()mul(250,300)<#$;+mul(840,193)who(562,102),mul(390,251)(mul(6,397%~what();%who()from()#![mul(95,829)where(811,818)@mul(847,742)'~+&~@/mul(329,961)>~mul(625,917)#+what()%?>mul(314{mul(392,487)mul(770,684)]'mul(607,73)]where()/#what(378,688) :}'why(778,249)mul(732,423)from()$;@why()>mul(255,618),#+from(849,914);>mul(99,409):]mul(948,905)select()<@mul(342,35)$!@how()/)where():mul(49,617)mul(396,154)>mul(671,367)mul(68,795)~select()<:select()~/mul(900,855){ why(622,665)#when()-<@mul(629~{;~+how(){'mul(907,182)}<;+{' mul(223,519)}+>mul(776,473):where()what()^when()don't()/^ -/(/mul(894,814)mul(698,226)}~/mul(570,960),?@?what()select()}/mul(918,543)'[from()&why()where())~from()[mul(321,507)mul(616,831)why()when()/]{mul#>[!!; mul(480,401)'%%~](from()mul(643,85)who()where()mul(982,510)when():,(mul(799,43[from())$what()%where()@;)mul(420,538)how()mul(358,891)who()what()what()select()(?how()*)mul(612,717)<+(where();who()from(170,645)how()why()where(310,422)mul(789,673)mul(779,49)what()who()[from()$*'&mul(211,472)why()< mul(77,895)?&:*-;^mul(861,148)/what()[+#}when(360,356)mul(905,744):~<-how()][-where()^mul(272,757select()'mul(994,335) what(362,794)$;$mul(242,327)who()when()who();don't()$mul(808,996);don't()/}from()(what()who()mul(398,570)from()~select()[mul(420,441)+mul(452,212)who();~what()#how()what()mul(557when(699,863)mul(184,806)&')from(),:'';don't()[select()mul(139,882~^(how()&mul(931,970)>]] &do()&*)(,:;,mul(924,272)who()$$%select()?/[mul(712,215)~,mul(114,862) :select()#who()$&how():mul(617,150)]why()~(&@?mul(28,990)-)mul(221,546from()^:<&/[select()mul(5,78)mul(476,316)(<'%[mul(227,163)from()where()who()why()[ mul(229,680)>/+?how();select()&$[mul(110,33)~{)#who()]^+/mul(479%%#{#from()select()when()what()what();)//mul(229,348)how()*/mul(643,351)mul(615,362(/->(how()-when()mul(499,697)*don't()mul(992,821){from(413,389));when()who()#mul(921,742)mul(253,580)]how()how(102,372) mul-from()where()mul(104,127)what(),{what() what()[*mul(657,659)'-select()mul(612,851)how()<~-when()$select(718,662)from()(!mulselect()-/^,<&^~mul(497,827)who()-how()-$select()+*mul(943,533)@;mul(403,629)why(826,610)} +:>mul(943,942)why():-)>^why()what()how()mul(302,757'mul(22,286):/-{mul(391,954)mul(528,734)select()-where()why() mul(909,426)!/($+mul(106#&-from()^mul(592,459)'(select()]!when()@{}*mul/&'>mul(894,472)who(),-#mul(924,264)%where()-{from()!mul(956,587)-$do()&why(173,205))$&~where()#&}mul(615,17)how(){>%from()from()@where()mul(683,358),how()when()-}](;/mul(688,622)/select()}(what()mul(872,568)/why(){mul(600,562) #mul(733,946)( ?]/when()$(mul(606,986)@!when()mul(597,648)what()-who()from()?,>]!'mul)>-&@~who()/%!mul(486,264)from())mul(556,968)(who()[:$:,*mul(564,519)# %)&/from(390,158)mul(583,746)how()why()('#/mul(519,835)&(/?^#,mul(447,762){?,]]]/@mul(257,451)&<$why()(mul(670,126){#:mul(555,660)}+%$:(select()mul(723,37)why()who()}where()}how()%)>don't()#where()how()]%what() select()mul(726,542)how()mul:how()/~}>) mul(753,350)mul(905,645)+ how():(when(879,434)mul(632*?'$/,<*what()mul(442,98)$&(&;mul(424,515)!mul(443,813)**),^%how()what(),mul(252,469)select()[)mul(370,416)%&::&+%mul(885,78)how()^mul(885> {&,why()$mul(52,196)+,{%select(),!##;mul(714,770)mul(607,394)when()how() -@]mul+^@mul(90,350)~@+where()mul(934,150)when(788,941)^mul(557,327)mul(86,867) :~$-how()select()who()mul(166,855) what() %]mul(928,22)%when()-how()$!what():mul(628,252)~{>,who()~where(967,401)#mul(943,366)'[*>@mul(781,986)>:when()?&don't()~ :where()who()select():what()mul(839,261) *&*where())/]when()mul(24,536)how()how()'who()why())<,~mul(254,257)^@:where()mul(945,657)!&]select()from()}'[#)mul(148,151)-#!/usr/bin/perlwhere()>%why()}!/]{;mul(549,60)
+how(477,669) mul(853,888)<[/who()>}+mul(361,751)mul(837,651)-mul(8,515)(}>!!# do()&@!:^][@mul(143,286)&?^&*how()&!'mul(88,781):}who(){!*!&mul(348,435)mulfrom()?>]-}+ }@mul(33,697)do()what()why()}(#]:mul(3,176):$mul(613,679),'how(882,581)who()*mul(519,798)from()mul(865,503),+~mul(767,837)/)?^why()/mul(520,288)where(){)who()what(); )mul(274,562)$:<^*what(423,612) from()>)mul(375,282)#select()from(646,967)?(*!'$mul(991,635)mul(598,876)%^?+mul(716,646)!)&mul(699,500){^^who()when()from()what()mul(314,198)%@;mul(419,800from()]$mul(844,419)$&]mul(317,754))<;^@(mul(222,12)##:what(751,642)$[from()%;mul(205,32)when()&{>+'>why()+mul(864,418)*@select()mul(911,629)*why();)^who()mul(248,4)}mul(132,503)/when()why()%mul(441,482)-mul(818,349)(#(where();(who(22,952)mul(534,621)$'~]where()why()-mul(199,973)mul(746,506)@'select()%{mul(866,951)from()mul(381,827)[select()*}(what()mul(744,979)mul(907,379)how(347,456)who()@what()##>;@mul(114,609),}what()'mul(406,863)][who()/when()mul(900,454)<'-)->[select()!select()mul(499,399)who()mul(349,409)',-~)select()mul(234,866)'why()mul(225,989)-(-mul(626,378);,$who()mul(597,85)mul(977,267)select(){mul(111,206):(&mul(989,396)#[:)<~{who()select()mul(689,817)mul(240,827)#how(){-+-@mul(663,156)'^$from())mul(416,908)*%why(714,896)#^+mul(993,707)'when()#;who()>where()select()?mul(978,206)@how(315,762)*/>why()({mul(998,362)who()$<(mul(488,946)},when()):}?where()where()}do()[!;?~{select()mul(673,574)%[::@;why()#]+mul(455,366)$~:mul(351,347)%,~-?what(595,890)]*select()mul(186,325)where()/:why(744,171)mul(513,868)/+why(118,201)mul(691,608) %mul(469,265)why()do()[mul(80,813)*<:mul(925,31):((mul(640,344)when(758,885)where()mul(474,482)?[>{where()]!mul(66,500)why()![# -mul(549,187,how()'where()*don't()#-<>%select()?who()]mul(581,943)?]what()}?) mul(54,791)]do()+$-)mul(255,793)who()]mul(338[)how()!@mul(253,351)++who()$mul(696,214)select()&mul(899%what()~}/what()-mul(302,687)when()#&mul(842,464)}?^$when()([()mul(579,190)@mulwho()where()~mul(238,298)from()<^(+,mul(766,436)how()^)%':{mul(427,646) ?%}(?mul(995,814)#~where()'}mul(267,274)']mul(174,583[,((!what()+when()*)mul(146,807)!:where()+!mul(856,39)?;@!mul(653,577)%}^do()^mul(961,701)::mul(23,391)what()^*~-do()how()how(832,138);!}($#+mul(841,486)how()+# mul(255,21))-$who()when() -)> mul(427,236);&who(),where()+{mul(97,633)
+::where(946,25)!where()do()?where()-why()mul(129,728)>^&mul(557,253)mul(535,49)who()~$>!mul(950,144)select(399,41)'':[when()mul(984,990)%/:select()~'^'@-don't() )mul(862,540)from()]who(964,165)don't()from()mul(378,581)[[from(295,573)~]/!)mul(29,139)mul(992,600))mul(560,53)>mul(342,811)([*don't(),+how(398,338)}why()<:mul(556,398)[@??:^(),how()mul(708,821):;-?where()/when()select()%?how(955,77)why()mul(428,310)how()where()'mul(759,360)(#>;where()when()mul(396,975)}{mul(131,376)(!@what()%] @mul(100,818)mul(478,394)<%$<:%($&/mul(337,545)mul(227,220)who()-'+why()select()select()don't()why():';!mul(49,915)+))[do()?[when()mul(886,984)'^ who()>when()~mul(468,20)from()(<>why(){mul(791,347)? &} +mul(389,748)/[<;when()select()*mul(370,770)::[select();what()mul(63,701)why()^mul(361,364)when(592,110)select()+: ]mul(988,308)$mul(693{from()!(how()~/mul(782,22)why()mul(355,443)}<)%how()how(){[mul(47,507,^}>)don't()why()mul(459,418)?who()/(how()select()when(456,391)?select()mul(451(mul(473,946))who()how()*mul(733,242)mul(575,863)why()*>&,}%!]^mul(613,249){#from()mul&]who()where()}+}}$+mul(94,794)mul(813,82)#mul(294,897)mul(995,245)!%#!^why()mul(411,763)/}what(),)mul(952,776)mul(868,728) ':~$}mul(869,784#who()don't()%@-} (mul(766,260)']who()@^&select()mul(723,930)what()what()from()-#~!mul(873,766)%:,?mul(520,521)& mul(407,520)select()$mul(547,416)~?}%^mul(677,996)mul(661,622)[~!mul(310,928)^;>-mul(740,171) /$#$*don't()select()>: &mul(306,628)*{select()$mul(705,686$/mul(803,660)mul(485,760)[select()'select(){@mul(917,878)#mul(188,324)(>}<:select()'mul(281,982)(select()},what()mul(730,931)}-#mulwhat(469,510)select()'from()where()#from()#do()/mul(869,458)
+when()from()mul(912+{@mul(635,991)>}mul(158,871){[*{>'$*/ mul(686,481)mul(339,86)$>how()[when()mul(78,204)+&'mul(58,734)<{who()where()]';~mul(964,213)&select()where()@where(513,771)mul(471,186)'%$)@~({# mul(517,787){+%from()>]{,mul(762,604),~from()~+do()select()mul(827,656)$^>['-what()mul(318,236)select()'+>who(530,155)*mul(394,518))select()from()!)select();:mul(805,79)why()}how()/&?mul(924,569)who()$%where()]~*&[why(621,535)mul(152,407)[why()]#mul(478,24)mul(107,697)select()'>~mul(481,432) mul(248,61)^:+don't()mul(400,374)^]{who(){mul(959,329)from(){))]mul(566,182)}what()(where()>from()&don't()select()who():+?!]]/mul(766,741)why()@ !how()who()?select();mul(470,17)/mul(374,487)%@@mul(685,185)} {<#(mul(845,259)'why(230,429)[??^select()^>/mul(791,324)$how()/?mul(478,641)+/ <{(when()mul(794,547)why()[select()!*-mul(474,709)#select()# select()}select()mul(896,775)select()-where():!mul(817,123)mul(333,359)mul(433,461)mul(722,474)@'!@$mul(49,892) #(+,mul(726,435)what()>,;mul(957,798)) #%)$ mul(541,867)-?*# do() -]who(265,168){'*>{mul(770,902)+,-who()*what()mul(21,402)mul(843,622)~#mul(604,248)how()%(why()where()[;where()+mul(342,802))from()*when())#,<#,mul(439,954)}@-&)>+what()mul(593,520)>?,what();+,select()~mul(202,526)where()+#-]? mul(654,204)>why(),(]+mul(95,133)mul(626,152)@,[+mul(811,855)when()$when(387,144)when()who()mul(781,279))+&@&mul(77,160),why()%from()do())#mul(982,99):mul(722,476)mul(757,193)from()when()select()who(){mul(569,549)]*$mul(943,277)why()@who()}{from()!when()]mul(714,885),;*do()@where()^how()mul(941,709)~@{when(215,138)how()mul(772,310)~,what()>who()!?++]mul(858,573)-what()<(from()from()mul(254,457)mul(890,367)from()why()[mul(590,183)/@who()*#-^?~mul(446,447)how()$select()mul(734,361)]~where();}when()mul(50,364):(where()-<^why()!&mul(692,682)from())&mul(949,43)mul(923,776)^/mul(987,377)!who()mul(286,329)#what()~from()^who()#/mul(13,658)why()>@(>]mul(592,423)mul(148,486)*mul(878,721)$%#how()what()mul(710,18):[#%do()where()@!(~mul(357,115)where()select()how()don't()mul(356,206)@,? how()^^what(295,729)[mul(759,861)from()*/select(334,18)&*how()@>what()mul(580,828)+;where()^;*select();what()mul(542,530)~where()[mul(549,51)'!mul(12,992)#why()don't()!;how()-(+{(mul(543,363)[what()from():mul(135,364)/select()mul(312,500)@where()[when()&$)]when(610,72)mul(215,533)~;who()}how()from()*)>~mul(522,58)@mul(402,510)!!;who()mul(867,26)-mul(25,987)?select()mul(973,76)why(){(/mul(148,345))^'%@when()-how()mul(233,85)
\ No newline at end of file
diff --git a/src/2024/2024-12-03/lib/extractMultiply.ts b/src/2024/2024-12-03/lib/extractMultiply.ts
new file mode 100644
index 0000000..1406d6a
--- /dev/null
+++ b/src/2024/2024-12-03/lib/extractMultiply.ts
@@ -0,0 +1,65 @@
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+const mul = (x: number, y: number): number => {
+ if (x === undefined || y === undefined) {
+ throw new Error('Missing operand')
+ }
+
+ return x * y
+}
+
+/**
+ * Extracts and processes valid mul(x,y) sequences from long text and returns their sum
+ * @param corruptedInstructions {string} Corrupted multiply instructions string
+ * @returns {number} Sum of valid mul(x,y) operations from corrupted string
+ */
+export const extractMultiply = (corruptedInstructions: string): number => {
+ const instances = corruptedInstructions.split('mul(')
+
+ // 3 per number (2x), 1=comma, 1=closing parenthesis
+ const maxStringLength = 8
+ let multiplySum = 0
+
+ for (let i = 0; i < instances.length; i += 1) {
+ const line = (instances[i] as string).substring(0, maxStringLength)
+ const multiplyText = 'mul(' + line.substring(0, line.indexOf(')') + 1)
+
+ try {
+ multiplySum += eval(multiplyText)
+ } catch (err: unknown) {
+ if (err instanceof Error) {
+ // console.log('eval parsing error:', err.message)
+ }
+ }
+ }
+
+ return multiplySum
+}
+
+/**
+ * Extracts and processes valid mul(x,y) sequences from long text that are preceeded with `do()` conditions.
+ * Ignores mul(x,y) sequences preceeded by `don't()` conditions.
+ * @param corruptedInstructions {string} Corrupted multiply instructions string
+ * @returns Sum of valid mul(x,y) operations from corrupted string
+ */
+export const extractMultiplyCondition = (corruptedInstructions: string): number => {
+ let multiplySum = 0
+
+ // Clean and normalize text
+ const instances = corruptedInstructions
+ .split('do()')
+ .map(line => {
+ const indexOfDont = line.indexOf('don\'t()')
+
+ if (indexOfDont >= 0) {
+ return line.substring(0, indexOfDont)
+ }
+
+ return line
+ })
+
+ for (let i = 0; i < instances.length; i += 1) {
+ multiplySum += extractMultiply(instances[i] as string)
+ }
+
+ return multiplySum
+}
diff --git a/src/2024/2024-12-03/quiz.test.ts b/src/2024/2024-12-03/quiz.test.ts
new file mode 100644
index 0000000..9f82b63
--- /dev/null
+++ b/src/2024/2024-12-03/quiz.test.ts
@@ -0,0 +1,10 @@
+import { test, expect } from 'vitest'
+import { quiz20241203_01, quiz20241203_02 } from './quiz.js'
+
+test('sum of mul(x,y) texts', () => {
+ expect(quiz20241203_01()).toBe(187194524)
+})
+
+test('sum of mul(x,y) texts', () => {
+ expect(quiz20241203_02()).toBe(127092535)
+})
diff --git a/src/2024/2024-12-03/quiz.ts b/src/2024/2024-12-03/quiz.ts
new file mode 100644
index 0000000..4c6a26a
--- /dev/null
+++ b/src/2024/2024-12-03/quiz.ts
@@ -0,0 +1,28 @@
+import path from 'path'
+import { currentDirectory, readFile } from '@/utils/file.js'
+import { extractMultiply, extractMultiplyCondition } from './lib/extractMultiply.js'
+
+const directory = currentDirectory(import.meta.url)
+const input = readFile(path.join(directory, 'input.txt'))
+
+/**
+ * Part 1/2 of the 2024-12-03 quiz
+ * @returns {number} Sum of "mul(x,y)" strings from long text
+ */
+export const quiz20241203_01 = (): number => {
+ const sumMultiply = extractMultiply(input)
+
+ console.log('MULTIPLICATION RESULTS:', sumMultiply)
+ return sumMultiply
+}
+
+/**
+ * Part 2/2 of the 2024-12-03 quiz
+ * @returns {number} Sum of "mul(x,y)" strings with conditions from long text
+ */
+export const quiz20241203_02 = (): number => {
+ const sumMultiply = extractMultiplyCondition(input)
+
+ console.log('MULTIPLICATION WITH CONDITION:', sumMultiply)
+ return sumMultiply
+}
diff --git a/src/2024/2024-12-03/sample.test.ts b/src/2024/2024-12-03/sample.test.ts
new file mode 100644
index 0000000..19e85b4
--- /dev/null
+++ b/src/2024/2024-12-03/sample.test.ts
@@ -0,0 +1,15 @@
+import { test, expect } from 'vitest'
+import { extractMultiply, extractMultiplyCondition } from './lib/extractMultiply.js'
+
+const data = 'xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))'
+
+// eslint-disable-next-line
+const dataCondition = "xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))"
+
+test('extract mul() and process - demo', () => {
+ expect(extractMultiply(data)).toBe(161)
+})
+
+test('extract and process mul() with do() - demo', () => {
+ expect(extractMultiplyCondition(dataCondition)).toBe(48)
+})
diff --git a/src/index.ts b/src/index.ts
index 357f999..3b0c3ca 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,6 @@
export { greet } from './sample/greet.js'
export { getTotalDistance } from './2024/2024-12-01/lib/listTotalDistance.js'
export { similarityScore } from './2024/2024-12-01/lib/similarityScore.js'
+export { countSafeReports } from './2024/2024-12-02/lib/countSafeReports.js'
+export { extractMultiply } from './2024/2024-12-03/lib/extractMultiply.js'
+export { extractMultiplyCondition } from './2024/2024-12-03/lib/extractMultiply.js'
diff --git a/src/utils/numbers.ts b/src/utils/numbers.ts
new file mode 100644
index 0000000..fc271eb
--- /dev/null
+++ b/src/utils/numbers.ts
@@ -0,0 +1,13 @@
+/**
+ * Checks if a number-like input is a number
+ * @param str {string | nummber} Input parameter
+ * @returns {bool} Flag if the input parameter is a number
+ */
+export const isNumber = (input: string | number): boolean => {
+ if (
+ typeof input !== 'string' &&
+ typeof input !== 'number'
+ ) return false
+
+ return !isNaN(Number(input))
+}