this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

2023, day03: first attempt, too low

+338
+9
2023/day03/deno.json
··· 1 + { 2 + "tasks": { 3 + "cache": "deno cache part1.ts part2.ts", 4 + "pull": "aoc --day 3 download --overwrite", 5 + "test": "deno test --watch", 6 + "p1": "deno run -A part1.ts", 7 + "p2": "deno run -A part2.ts" 8 + } 9 + }
+37
2023/day03/deno.lock
··· 1 + { 2 + "version": "3", 3 + "remote": { 4 + "https://deno.land/std@0.208.0/assert/_constants.ts": "8a9da298c26750b28b326b297316cdde860bc237533b07e1337c021379e6b2a9", 5 + "https://deno.land/std@0.208.0/assert/_diff.ts": "58e1461cc61d8eb1eacbf2a010932bf6a05b79344b02ca38095f9b805795dc48", 6 + "https://deno.land/std@0.208.0/assert/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7", 7 + "https://deno.land/std@0.208.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", 8 + "https://deno.land/std@0.208.0/assert/assert_almost_equals.ts": "e15ca1f34d0d5e0afae63b3f5d975cbd18335a132e42b0c747d282f62ad2cd6c", 9 + "https://deno.land/std@0.208.0/assert/assert_array_includes.ts": "6856d7f2c3544bc6e62fb4646dfefa3d1df5ff14744d1bca19f0cbaf3b0d66c9", 10 + "https://deno.land/std@0.208.0/assert/assert_equals.ts": "d8ec8a22447fbaf2fc9d7c3ed2e66790fdb74beae3e482855d75782218d68227", 11 + "https://deno.land/std@0.208.0/assert/assert_exists.ts": "407cb6b9fb23a835cd8d5ad804e2e2edbbbf3870e322d53f79e1c7a512e2efd7", 12 + "https://deno.land/std@0.208.0/assert/assert_false.ts": "0ccbcaae910f52c857192ff16ea08bda40fdc79de80846c206bfc061e8c851c6", 13 + "https://deno.land/std@0.208.0/assert/assert_greater.ts": "ae2158a2d19313bf675bf7251d31c6dc52973edb12ac64ac8fc7064152af3e63", 14 + "https://deno.land/std@0.208.0/assert/assert_greater_or_equal.ts": "1439da5ebbe20855446cac50097ac78b9742abe8e9a43e7de1ce1426d556e89c", 15 + "https://deno.land/std@0.208.0/assert/assert_instance_of.ts": "3aedb3d8186e120812d2b3a5dea66a6e42bf8c57a8bd927645770bd21eea554c", 16 + "https://deno.land/std@0.208.0/assert/assert_is_error.ts": "c21113094a51a296ffaf036767d616a78a2ae5f9f7bbd464cd0197476498b94b", 17 + "https://deno.land/std@0.208.0/assert/assert_less.ts": "aec695db57db42ec3e2b62e97e1e93db0063f5a6ec133326cc290ff4b71b47e4", 18 + "https://deno.land/std@0.208.0/assert/assert_less_or_equal.ts": "5fa8b6a3ffa20fd0a05032fe7257bf985d207b85685fdbcd23651b70f928c848", 19 + "https://deno.land/std@0.208.0/assert/assert_match.ts": "c4083f80600bc190309903c95e397a7c9257ff8b5ae5c7ef91e834704e672e9b", 20 + "https://deno.land/std@0.208.0/assert/assert_not_equals.ts": "9f1acab95bd1f5fc9a1b17b8027d894509a745d91bac1718fdab51dc76831754", 21 + "https://deno.land/std@0.208.0/assert/assert_not_instance_of.ts": "0c14d3dfd9ab7a5276ed8ed0b18c703d79a3d106102077ec437bfe7ed912bd22", 22 + "https://deno.land/std@0.208.0/assert/assert_not_match.ts": "3796a5b0c57a1ce6c1c57883dd4286be13a26f715ea662318ab43a8491a13ab0", 23 + "https://deno.land/std@0.208.0/assert/assert_not_strict_equals.ts": "4cdef83df17488df555c8aac1f7f5ec2b84ad161b6d0645ccdbcc17654e80c99", 24 + "https://deno.land/std@0.208.0/assert/assert_object_match.ts": "d8fc2867cfd92eeacf9cea621e10336b666de1874a6767b5ec48988838370b54", 25 + "https://deno.land/std@0.208.0/assert/assert_rejects.ts": "45c59724de2701e3b1f67c391d6c71c392363635aad3f68a1b3408f9efca0057", 26 + "https://deno.land/std@0.208.0/assert/assert_strict_equals.ts": "b1f538a7ea5f8348aeca261d4f9ca603127c665e0f2bbfeb91fa272787c87265", 27 + "https://deno.land/std@0.208.0/assert/assert_string_includes.ts": "b821d39ebf5cb0200a348863c86d8c4c4b398e02012ce74ad15666fc4b631b0c", 28 + "https://deno.land/std@0.208.0/assert/assert_throws.ts": "63784e951475cb7bdfd59878cd25a0931e18f6dc32a6077c454b2cd94f4f4bcd", 29 + "https://deno.land/std@0.208.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", 30 + "https://deno.land/std@0.208.0/assert/equal.ts": "9f1a46d5993966d2596c44e5858eec821859b45f783a5ee2f7a695dfc12d8ece", 31 + "https://deno.land/std@0.208.0/assert/fail.ts": "c36353d7ae6e1f7933d45f8ea51e358c8c4b67d7e7502028598fe1fea062e278", 32 + "https://deno.land/std@0.208.0/assert/mod.ts": "37c49a26aae2b254bbe25723434dc28cd7532e444cf0b481a97c045d110ec085", 33 + "https://deno.land/std@0.208.0/assert/unimplemented.ts": "d56fbeecb1f108331a380f72e3e010a1f161baa6956fd0f7cf3e095ae1a4c75a", 34 + "https://deno.land/std@0.208.0/assert/unreachable.ts": "4600dc0baf7d9c15a7f7d234f00c23bca8f3eba8b140286aaca7aa998cf9a536", 35 + "https://deno.land/std@0.208.0/fmt/colors.ts": "34b3f77432925eb72cf0bfb351616949746768620b8e5ead66da532f93d10ba2" 36 + } 37 + }
+140
2023/day03/input
··· 1 + ........897.......839...........651.399.............236...............................343...986...........308............................... 2 + ........*................*404......*............134.....953..508=.....................*....*..........325*..........744......392............ 3 + ...350..847..403...-..541.....622.................*....................356.......%..95...793....................830...........*.....163..... 4 + .....&.......@...105.............$..745............42...785.............*..443.412............922..............*...........663........*..... 5 + .253....../..........696.............*..................*..............817.$.....................*...........62........................373.. 6 + ...........244...419....*189....=........*...871.74...797...353.737................227..626.....429.726%...9......*956...803/.......*....... 7 + .793...........=.....-...........119..683.18.*...............@......+.....182..372....$.&...................*..756...............945.610.... 8 + ....*.........496.....395.....................929.746................76..*.....*..............673-...*.....47........591..271............... 9 + .....964..................241...........*............+.....+....590.......129.6....$.....@...........680....................*............... 10 + ..........523*448...........&....136.759.356............789.......*.................367.330..397.............483....354......354...869...... 11 + ...488................920........*...........................652...802....$.......*............*..............-.....................*....... 12 + ..../.........986....*......*....550.995......376...............+......641.....567.315.........887..66...863....552.936..........277........ 13 + .................*.800...354.464.......*.533......................20.......704..........918........*.....*...........*....214........&434... 14 + ........%.....589...................596..*.......373...-..........*....785.@......941......*....521.......908...897..610.................... 15 + ........384..........827*101....698......978....*......947.614.571....*..........@.....+...1.......................=......#73...734......... 16 + 122%..........*...................*..........993............./.....260.........+.....466...............%........................*........... 17 + ...........938.992........246......305...449......335...739................588..681.........920.....164.........................431......... 18 + ..558....$........................................@.....*.....................=............-............847.....879..51................624.. 19 + .....*.104....*818.......505.785.10...................161....210....................723..........55......*..424..&.....*.........723..*..... 20 + ...44......542.....975..................437...............51....*686.....*....../..*.........990*......708.....@....715...&....#.......997.. 21 + ...............801..@.............-....*.....702....&....*............238.236.706.183..+................................842.545............. 22 + ...........202*...................906..204...*...990......212....380%..................208...................66............................. 23 + ......./........../....878............................266.......................278...............920...................144.........423..... 24 + ....494..*.....976........@.....&.......*287...553-..*.............731...................649..247*........703......@....%....817....*....... 25 + .........856.......592...........708.404............707.......274...*........-............#.....................%.567.........*......431.761 26 + .............663.........974...............%...446.............*............751....793..........811....225.&...48.....860..887.............. 27 + ................&...........*.......673..536......-.........447.....@...............@...$..................816..........*................... 28 + ....822................@....251....$............................413..306.164.............540.....313..476..........@...586./65....840....... 29 + .....*......@.950.....266............$.........1...+...............*..........373..................*.............885.................*...... 30 + ......157.529....*.........341.....480.............60......765....122...633....+............$182....963.....................587..976.824.... 31 + ................172............685.....480....#........831*................*......747......................262..................-........... 32 + ....*......+438.....@......332./.......=...739..815...............356.....119.273.&.....317*674.......=...*....561..........192..........89. 33 + ....867..-........179..............319........../....74@..952*374...*.........*....................125....578...*...........*......652...... 34 + ..........549.............873.........*...=........*...............695.*.....126.........821.....................697.$......806.52....*54... 35 + ....792...........-...646*....770.....163.637....941........884.........744..............................#............800................... 36 + .......*.......181............@.............../........92..#...................518...654.......421*995.310....450...............771......... 37 + ...+................./48...........968.........269................904.......=...../.....................................266.....*........... 38 + .211....636.................630.17*.....%581........./843.....%..*.......878...............829.....119.33........211.........247............ 39 + .......*......................-...................%..........559..873.............*138.439*....687*..........130....*681.................... 40 + ....522.................792........896.........471...480*321...................125..............................*...................291..... 41 + ........616.......818.....$..858.............................659*826.....109.....................................10.564=.331...156...+...... 42 + ........*.......@...*..29....*...@......546.............907.............*.....965.......217.808.....802..212...............*................ 43 + ....607.976..641..852.@...330...158....../.......630........247.......503........$.335+....*.........*..*....618...423&.335...803........... 44 + ......=..............................502........#........-..*.....923......664....................421...395.-..................#............ 45 + ........*.................625....646..@...99............901.59......*.....*..........517.$747.*....................315..............79...922 46 + .....289.789..............%......*.........*......................762....388..189.....*........277.........*222...*.................$....... 47 + .................................738....406.....462...........................*.....915..............505/.......61.....+.......202*......646 48 + ..749..............163............................*.....963..........907.......979....................................223..716.....265...... 49 + .......&....741............362.......117.......837..96../.................#..............786.256.....942..=970...983........*............... 50 + ......133......*486.725.......*....../...............%................930.310...................*733.-.............$.....198.........189.... 51 + ....................*........256........68.......267...873........418*.....................573.................................219..*....... 52 + ......+.....439..525..187........495..............*...=.......923..........327..988..300........447*59..702../..840......40.....*........... 53 + ......731....*........*..........*..............547.......453.....6.$.........*.......*................-....447....@.......*.737............ 54 + .907#.......375........195.....707..17.................9..........%..119...147..594.22.......81.........................485......446........ 55 + .....................................*....#............*.....62...................*...........*....569...935.868....-...............*528.... 56 + ...#..........209........229.......787.470..............403........892.........816.....923..811...$.........*......104.907.849....*......... 57 + ..154.346.....*...361.........................10/...237................-................*.............600..............*.......998.606...... 58 + .........%...216..*.......*.........*368.869.........#................6..98...........53.............*.....850@...102...751................. 59 + ....550............727...383.....818.....*...913.............879...........*.....420.....150.........708.................................... 60 + 705*.......@688.......................289.....*.........................431........*...+....*50.....................698...668*144........... 61 + ..................501..70.520....$32......562..458....170......279$............504......883............/...44........*...................... 62 + ..450..107@........*..................586*...........*.........................*....510............788.274............589...-26......&...... 63 + ...................342.........&.551+.................302...............286.....931....&....-649..$.............575................185...199 64 + ............602..............470.........243*......@............818.690*.......................................*....863..793*............... 65 + ......934.....*......200.936.....46..........137.72.........377*......................443*372........498....320..#...........553......598... 66 + ........-...451./952..*...*....*.......................804..............305......700............675...&.........611......................... 67 + ......................393.......708....957........*697......808.....138*.........%......186....*....%...162*...........624........244.%..... 68 + .....220*.........872......*...........*.........7.........................................=..6....391......562...880.....*......#....120... 69 + ...+.....608.........*...74.568........193.........379.........$682......933.927&.....&............................./..984.................. 70 + 93..553........*768.739...........421.........880.....*....737.............*.........69..................................................... 71 + .........334...............................40*........910.................................+465..682.............141*.......248..80.......... 72 + .........=..................323...172.............506..............503........568....785+.......%.......940*734.......#573....*...*.....130. 73 + ...163@........%17..42..108*.......*...$......700..*..81...../...............+....%.............................#285.........499.523....*... 74 + .............-........*..........305.706.....*....942.....843........*.............378.861.......573.859.173............522............544.. 75 + ..........974.......517.756..762.............480.....................289................*...........*......*.228%..........*......628....... 76 + ....567........&274......+..../..........................................926.............391............214.............270...230..-........ 77 + ...........=...............52...../......155*150.......180&..*......482..&...884................-125...........................@............ 78 + ..........332..................318............................123......%......*...............=........................310.................. 79 + ....................856.154........@............161....192..................=..387.............384..*827................*..&400......588.... 80 + .......283.............*....@.......12.....309...*...$...........643.......885..........862................210.......449.................... 81 + .......*......937.........98.....&........*....560....884.......$.................866#.../.............622..*..901.............462.......... 82 + .....279............273......896..17.661..880...............138...632......66...%.............93......*....349...*........./......=......... 83 + ..............430....*....+.....*.....*............350...............*..........226.......621*......312........=..266....574..111........... 84 + ..339........../.....770.451....122........990.....................811...780........*448.................325.249...............+...$...441.. 85 + ......................................$......%...........793..............@..787.766....................................64..+......252.*.... 86 + .........556........../.....256/...267...336.....897..........524*417.........................950...930$.452........164......713.......592.. 87 + ....759....*...........672.................-.868....*....613......................401.....742..*..............560........=.........939...... 88 + .....$...780.......195......578...............*...%...+....*.....=.....&.............*......#...645...636.797..........652...........*...... 89 + ......................*......................77...97.988.821...882...977.......127.609.914...............*.................................. 90 + ..........+...195&.....930.....872.......................................79..............&.....14...................-.......150..274........ 91 + ..........473................9*.............951&................./...827*.............46......-...13....751.........640.......*.....*504.... 92 + 898................-.............56*....378..............291..310..........58............937.....$.......*.../.............840..714......... 93 + ............-321.128.157............549..-....130....478*.........*.....................................123...164..............*....631..... 94 + ..516..989@..........*.........*670............................204..577.......&817....@514........790...............816.........148.*....... 95 + .....*................233...........*838.....*951.....-954..........$.......&.................110.........99...........*..@187.......671.467 96 + 224...205.....552................823......343................490*...........377..................*.......$...........779.......408.......... 97 + ............./..../.....................................166*..........120...........452.........148...=.......................*............. 98 + .562..............768.........#.267.29...806*......476......214.........*....*......*...............867.211....248.$870....@...829...*...... 99 + ...*..826@...................1.....*.........251....+.....#...........211.893.403....702.......44.......*........+..........75......977..... 100 + ..368.........861$......867....=.......................834.....................................=.........507................................ 101 + .......721*............*.......912.#497....................87-.....231...894.......968..........................659$.......@..........564... 102 + ...........690.......432....@..................332................*.........*756..*................302..214*.........803..855............... 103 + ..................26.......943...........633...*.....299.150....639.................796.....440.............428......+...........538.647.... 104 + ........31........*............................260.....-................=..261.............*............................644.303..%.....-.... 105 + 227..........#.161....*....&.....305...............345........328....639...*........$.......802....612.185................%../.............. 106 + .......683.953.....224....58.....*.................*....799...............944.964....245.............*.%................@......28.19.242.97. 107 + ....93*........../.............908.........$249..480.......*......978..............................58........=209......373.802*.........*... 108 + 467...........201..........932.....997......................548................/.....-904.....796.....3+............................915..... 109 + ...................#......@.......*......748*965.................922......451..169..............$.945....372#..979........%..436...*........ 110 + ........&.....880&..789........14.805..............571....222/.....*.70......*........./958..........%.........&.../....61.....*...73....... 111 + .......280.................................=.861......-.........144...........950................%.......907......910.......396............. 112 + .....+.........592*149.820*511...........298....&.......*264..........-..527..............-.....679.......*...............@......50*270..... 113 + ...901......=....................@483.............$..936......625%...619....%..........748...............785...860......26..181.........747. 114 + .........85..640...#........=.=.......49.......216.............................268*.............................#...........#.....53....*... 115 + ...........+.......744...933...766....*.................%...............*714.......909................................999...........*...311. 116 + .............783....................947.................352...765..............897.....+430..869.................121.%............236....... 117 + ...45....*......*..752......617..................332...........*...236...........*..........*....@.528..........&......530.................. 118 + ..../.134.713.871..*.............*...........#.....%.930...........*....323....377........678.544..*........542.........$.......470.629*786. 119 + ..................259...&.....959.225......177.......*.....912*..........$.........................306..996.*....*.........*681...*......... 120 + ..........250*768......598.........................850.........598..............3*.........904*648........=.372...197...410......152...=.... 121 + ............................................507@.......960..............362.164...131...................................................115. 122 + .....746.......117..678=........952...303*.......+......................./..*...........$636../...597......37................351...=........ 123 + .......*.281...@...................*......337.258..814...687.....#922.=....772..611.153.......573....*.......*..............*.......518..... 124 + ....144.....*.......396...........240................+......*.........45.......+.......*...........479.&293..126.....784-...783............. 125 + ...........843...@....*..918*.............................986.....542...................117.....................................578.707..... 126 + ..984.............251........258....597$.650.........................*..................................928.409.684...547.......*....%...... 127 + ....&..489....931...........................$....356........................489..............302...............*............./...259.../996. 128 + ......./........*.................................*......385........63*911...*.........%........*578...633.175.........@804..421............ 129 + ..98...........188..........226....+...............909....*...................535.....798................$....*.796......................... 130 + ....*.....%...................+....531...563...........426......617*202.........................929-.......439....%..332.....+.23&.347...... 131 + ...364..149..............425............*.....662.481.......................788..$844..................506..........@.....693......&........ 132 + ..........................*....408...772....+.......-.......232*......*......*.............#.+294.....*.....706................435.......... 133 + ......566*972........631=.425.*...........14............984.....667..7.236....195..9.....222........757......*.....865..604&..*....344.&.... 134 + .................439..........710..............477*714..............................*544........368............395*...........435...*..204.. 135 + ..........229......+..596.179........../................165.542*47........147..............653..*...................466...........119....... 136 + .....690...@............@.......467..626........&......*.................*....=42.....724....+.816....262*.....237.@....549.383............. 137 + ......*.........750..............*..............202....967.914......279..................*........./......147.@...............*........480.. 138 + ...444.......84...#....+..........527......*351..............*......*................225..888.......806.............7......#...518.....*.... 139 + .............*........628...............749......*976.200.....852..354...23....=........*...............................138............833.. 140 + ..........964.................................211...............................578.....986.............879......59.........................
+75
2023/day03/part1.ts
··· 1 + if (import.meta.main) { 2 + const input = ( 3 + await Deno.readFile("input").then((bytes) => 4 + new TextDecoder().decode(bytes), 5 + ) 6 + ).trim(); 7 + console.log(answer(input)); 8 + } 9 + 10 + type Coord = [number, number]; 11 + 12 + type PartNum = { 13 + num: number; 14 + coords: Coord[]; 15 + }; 16 + 17 + export function answer(input: string): number { 18 + const grid = input.split("\n").map((l) => l.split("")); 19 + const [partNums, symbols] = getPartNumsAndSymbols(grid); 20 + 21 + return partNums.reduce( 22 + (sum, { coords, num }) => 23 + isSymbolAdjacent(coords, symbols) ? sum + num : sum, 24 + 0, 25 + ); 26 + } 27 + 28 + export function isSymbolAdjacent(coords: Coord[], symbols: Coord[]): boolean { 29 + return coords.some(([x, y]) => 30 + adjacentCoords([x, y]).some(([ax, ay]) => 31 + symbols.some(([sx, sy]) => ax === sx && ay === sy), 32 + ), 33 + ); 34 + } 35 + 36 + function adjacentCoords([x, y]: Coord): Coord[] { 37 + return [ 38 + [x - 1, y - 1], 39 + [x + 1, y + 1], 40 + [x - 1, y + 1], 41 + [x + 1, y - 1], 42 + [x, y + 1], 43 + [x, y - 1], 44 + [x + 1, y], 45 + [x - 1, y], 46 + ]; 47 + } 48 + 49 + function getPartNumsAndSymbols(grid: string[][]): [PartNum[], Coord[]] { 50 + const isSymbol = (c: string) => !c.match(/([0-9]|\.)/); 51 + const isNum = (c: string) => !!c.match(/[0-9]/); 52 + 53 + const partNums: PartNum[] = []; 54 + const symbolCoords: Coord[] = []; 55 + 56 + for (let y = 0; y < grid.length; y++) { 57 + for (let x = 0; x < grid[y].length; x++) { 58 + const c = grid[y][x]; 59 + if (isSymbol(c)) symbolCoords.push([x, y]); 60 + else if (isNum(c)) { 61 + const coords: Coord[] = []; 62 + let numStr = ""; 63 + let current = c; 64 + while (current && isNum(current)) { 65 + coords.push([x, y]); 66 + numStr += current; 67 + current = grid[y][++x]; 68 + } 69 + partNums.push({ num: parseInt(numStr), coords }); 70 + } 71 + } 72 + } 73 + 74 + return [partNums, symbolCoords]; 75 + }
+13
2023/day03/part2.ts
··· 1 + if (import.meta.main) { 2 + const input = ( 3 + await Deno.readFile("input").then((bytes) => 4 + new TextDecoder().decode(bytes), 5 + ) 6 + ).trim(); 7 + console.log(answer(input)); 8 + } 9 + 10 + export function answer(input: string): number { 11 + console.log(input); 12 + return 42; 13 + }
+40
2023/day03/puzzle.md
··· 1 + \--- Day 3: Gear Ratios --- 2 + ---------- 3 + 4 + You and the Elf eventually reach a [gondola lift](https://en.wikipedia.org/wiki/Gondola_lift) station; he says the gondola lift will take you up to the *water source*, but this is as far as he can bring you. You go inside. 5 + 6 + It doesn't take long to find the gondolas, but there seems to be a problem: they're not moving. 7 + 8 + "Aaah!" 9 + 10 + You turn around to see a slightly-greasy Elf with a wrench and a look of surprise. "Sorry, I wasn't expecting anyone! The gondola lift isn't working right now; it'll still be a while before I can fix it." You offer to help. 11 + 12 + The engineer explains that an engine part seems to be missing from the engine, but nobody can figure out which one. If you can *add up all the part numbers* in the engine schematic, it should be easy to work out which part is missing. 13 + 14 + The engine schematic (your puzzle input) consists of a visual representation of the engine. There are lots of numbers and symbols you don't really understand, but apparently *any number adjacent to a symbol*, even diagonally, is a "part number" and should be included in your sum. (Periods (`.`) do not count as a symbol.) 15 + 16 + Here is an example engine schematic: 17 + 18 + ``` 19 + 467..114.. 20 + ...*...... 21 + ..35..633. 22 + ......#... 23 + 617*...... 24 + .....+.58. 25 + ..592..... 26 + ......755. 27 + ...$.*.... 28 + .664.598.. 29 + 30 + ``` 31 + 32 + In this schematic, two numbers are *not* part numbers because they are not adjacent to a symbol: `114` (top right) and `58` (middle right). Every other number is adjacent to a symbol and so *is* a part number; their sum is `*4361*`. 33 + 34 + Of course, the actual engine schematic is much larger. *What is the sum of all of the part numbers in the engine schematic?* 35 + 36 + To begin, [get your puzzle input](3/input). 37 + 38 + Answer: 39 + 40 + You can also [Shareon [Twitter](https://twitter.com/intent/tweet?text=%22Gear+Ratios%22+%2D+Day+3+%2D+Advent+of+Code+2023&url=https%3A%2F%2Fadventofcode%2Ecom%2F2023%2Fday%2F3&related=ericwastl&hashtags=AdventOfCode) [Mastodon](javascript:void(0);)] this puzzle.
+24
2023/day03/test.ts
··· 1 + import { assertEquals } from "https://deno.land/std@0.208.0/assert/mod.ts"; 2 + import * as p1 from "./part1.ts"; 3 + import * as p2 from "./part2.ts"; 4 + 5 + Deno.test("part1", () => { 6 + const examples = [ 7 + "467..114..", 8 + "...*......", 9 + "..35..633.", 10 + "......#...", 11 + "617*......", 12 + ".....+.58.", 13 + "..592.....", 14 + "......755.", 15 + "...$.*....", 16 + ".664.598..", 17 + ].join("\n"); 18 + assertEquals(p1.answer(examples), 4361); 19 + }); 20 + 21 + Deno.test("part2", () => { 22 + const examples = ["abc", "def"].join("\n"); 23 + assertEquals(p2.answer(examples), 42); 24 + });