diff --git a/NOTES.md b/NOTES.md index b4dca7d..abfb0ff 100644 --- a/NOTES.md +++ b/NOTES.md @@ -24,6 +24,7 @@ Hmmmm, right now it seems even worse than GoLang. Though the Error handling is _ * Switching on strings * [Iterating over values of an enum](https://zig.guide/language-basics/enums) - [this](https://ziggit.dev/t/iterating-over-a-packed-enum/6530) suggests that it's possible, but testing indicates that that only works at comptime. * [Sets](https://github.com/ziglang/zig/issues/6919) (though, as the top comment points out, that's not _too_ bad as you can abuse a HashMap for it) +* [Descending ranges](https://github.com/ziglang/zig/issues/14701) - i.e. `for (10..0)`. Not a big deal, tbf, but annoying when needed! ## Not "missing", but... diff --git a/inputs/09/real.txt b/inputs/09/real.txt new file mode 100644 index 0000000..8b412ec --- /dev/null +++ b/inputs/09/real.txt @@ -0,0 +1 @@ +7148927114311312621327202214531266246993259146534978732724918235311235109093392738202244524078949368925112488754912412263092236585242084824072751838198038939812389513931176215598813066986182966086815436532037481169995469837871503877512974224194233027192283399644124759263618483141171581554893662036401935717789837635598934525557993056182017846478649028964342236770198275546526208954332845243786189642669849944116542621144013693970654299222822402846511371406068581696612973323999866611236482237340459578857568371247163342702569683166899762356998977285814847949467407243362434135613557930148681464749713053592919737042883554637168858726535514676873651762108281623729146321914556853070166178832862824929549180169551625370574348391619756680772979233230158782574253549491215186559789133692442545882695353525164123274279633191506312893937378394232245525129281067826152179622498988596367662721547357909258585354784339513097698236502356316551628221815971298339262529293069984394641156303012878486966661279388288298423019221430289031343977442560983786642898613911111536235692656280722797666367564564169216952285397688365017547498845312936654572986327838188137555489828599262080375039652729293665523163286630512633216233535384697975849078304023472454301994112690371332819727763576317191479349251194309550931965407279202825877176124371784532983045936472354034172494126317412440426184495321763465756547395684403516796979907933788363237913539149393988552733678720781016681699523236728083473636595921137055133724629254723852313028922512754560947378107440215744548630271838177744321974763677654430428287232035502721259783558058767737401780965541276692538462611453587378119573566873744110233296266087477018244285934692563484375187245238207322322175562612429092674067839720125164861689577418807323343618562928594337679048843442185334776918971662812162535861449695843099231821646051438712401829933784289554429299644167492611201336601655308690151296966044691418454917144590809848786538872486375836957541403085568667777073957783749867913251539144309454161849369041481270914029942722713697298572229536336894775496289189742062686667895291536150881587715583315715105024153485102394846334792580995452315477856535798589475567307570834395379314504330495569505175636012208350883437937074552565106893676616956847655580552048926231807325678049115991682396979864133815309249219547579180284674409788811345253144222124287065641293376870433341432814772764635419413728265457202265275981698791341676419439557367155572858380794855593439626242223717705884775578751565605397227421696821291330895643414234613452743379393788699744641370907814852729583673602652969582732131791035396498712657418034317581998264538526282947481648243894946277317458958317218233637566821790318999265693461240653978419230826376797445894960712518873833702648613743551143613765335215757751548452729327794887337151145762448022177827651611748750126021388030362696853411185328174355876720645110769167952573175398643731591646117994884897575260323614901095476286912754501366604772477544434379497223289386911769175042716257926568141915511280905523197578795273129362719837507817673335974396695715931281805658235531654516382825111248929161555273932076417098998510265812682336954168175245525187998880941227236071965769841558207587921643541115766823349646959018442745294169634969767050373834493846255752196890175743417427782242687629781063165833397951221463789591672335233018882579697067306011921322563871262886644165324141947984381428435332375234104735159729111783882786379058948896355434928937403151659243835094555014443884233895187382306337887036676065966465617315415073967683694167278714317387253183676744457439137347155679437226535935735531123680618545899792497323594357727339404488914741855375141123902215171588765881215891925069348172221814682296237346483846828724549142164957564626323635358833745777797686834517147881572621209286177288375498461791862842136711767831616442846740664153359043988538641565689580789979642834949044731622891787647135158781858357947660653697638119282564161876433429883410852112305999596628953984668287699531773498688175232227215771519151252551862110269464868016492140795563814445527099336846523092492947771113682122403369711539436072997485924625103395326788478755347220546741594695207254523759217279953528396416252855503348385992731029746022186949967438862583777837836383779856767092843395522745428143556955714843236398984243411510371622572746558863122747357578787194775646464711375761177319951812207680976421391321935353506832757864529014286593124471796958332114341465104177111884915557263940145298895421116772278596606728218278743099433331452152866499662398115143936560189822804230884983227156343995974576587512406794328394807560839793206439315945228878858098834926377473311999923358423885629382971899637324944186972655358965553519395368697278187454134080542852135275105577238334496378124679334914855781318599655776788136136250326953549836892097821629961997878853635643605241693997289883663643381474776783505259998924636926962641809964271222669013355932543566716298241964192515482598738125276155856918759266295595833686533243876315806884865960571714104160983011205066275467585913611614844263206962906748861849657552442915487689783122117832426452452674664370208978771590811685801331846273554027324758354336678896592895562869131874392641646940115445797656664958174373653514356665613764855888974294235923191740653153292064406759986461163786513916297480342977504760575540564655184723236696272454531729922575512782958027722743415333278289271426777844434258572969379145157441627365272113956919101513138649277480725397245097612794727670622251769271805177233240601014119417131638301156824290232984624864647590632246833928902136348718199494108087403218525470892210229329763354507695652882307659754153794798574630129863612128156421489358894893967976429462384696315886777754995525485927664129669616851332944995426469357413539594309622537073891575362262928824543860913053395574855446407045378546583536221478557837611768816037751075553895461178608542109654715370154874577631751022823841743114196014511811863414306083555536979097957943852847408851609653685785959735855031166317447752209845863323162775295283584832532393962557973855595261442153676879579444296268584642887158317922555089237049904176499917651960772641958295499242186653678386631019219943218567896733572791146435233145668435873995659063864761868294278054527020975652267497968172685126223120707714242764724758965017352763123122601376983678613847963770773716275389222255127953873815115039688448234749546840921272622758909312295853957660654017123489596016852573694886924841677928949684497586741164228545522214227978741362613869373282732962985165474138239089605592227026829840661928213626824058336786574786198223767413281030842523603452146555765966663954671956814090611686756784935774474172769184453345504916282598792815173339484687454064573798619480252288346973736127246633382586955363539947649178711819648623486249894328656153138043695676478081496852738097816482735655829358736115815952457560485081111988376025929741696054544030233730905061214654455628825311335620469269654864619218355229322733823849808416399047152288181584346411518163716221734274785642883690166675165981458675381837596428527672231869427238169650143434957718355655936517866551122532287299518777856860294988219579313760465491371127322639598694532089344025135568586010907390838424224844878141266252672562274135205351332999636342983168227269774452801929345928981295329727687690508644136242812723196682897022417811219124134626812053598895346128349541876860842083293491148037768859698761433263316810882366212112832940375522451537161343237189946659292820193883983011167360434616517252168733826383463398859680968394266654894622408757306193214587243965733854685030425028627919911575936678213279281566104940532683111998112913255942938764415742103959628990344564685270407059932495173665398912107578104512913439591655695576121071448956963249785134881070362218828557288723171247621683983567728473688574179786402669254836294973335815477799689664322467549654481822179436694727645911398812356582893260694349132073426384572559404434644835589019718231284658225051127052555370676478938071354318642449287669172125706474527730597765154757159718963667815841417873828068737714237975981591447618917777867844835677171481764776375031113033936232125824685886871471263082451690435454534540118373537727483945698757277086111848277933758065227072778631176110232644647053388084992873198014834630586524254530664895287375139125953458546764382989215061949699762916841371892261774662586196852979463379786273625677987652308223847527149636826643407084315677583517994983602164445158614332127548781770664191441188824988693141708847363592533443382156834736706029979098259722585663268377437782789252488844444294758918272857112872836067152939902611382436923532309416655788155560651556914144591329736658352015627182472622665977276672849251771077879595682919516059941046946673971291105141327011931052877934251997389654522558451617915497735420512098826476535476238715384048518252115716445136379690258231881658395958485894943880181022387743493992115234166795285882937648619532258815548514396155525816232746455662272381956833614360316631979721864043695087297778721794985360718591835665125935677510467612562988551730909027372022229687468555597674646818509720983624164523862661545082338985228747494142916339719142773869556697978240481119639697726269984352735847111435843047362913121227494788434232776444685730771668206128173798873644413360218370707656844494895682581874889795916750461096721174761512409017742595585383261989657684715639756674768760162389904692823852929584287972597360433850721620528716872588636192393851665331294166556326919884827559214563305178188836605840469682159074743174253622476624154339937445499891803140356124484828894348767318238970802795333999279825655651848575864034761016121151876492322958709238338822126428519056447381867175437815292220246923881465847352329379794886844314274317951875669121963831819952811316587024152955472713588663419654636219704335192481674678426482126032244219399070858393688844206114124980301855878230567720274719985775556825835258337134956196901381548589596216297615433922174078177222162771331565449929992916352039576931994977375053729454109933635742834485464765478278438730258447123884741159475267596597554851318247811445562750787749252535503438745474516731784649195127489675229195887942962591516240516086174545906014791462116926984690467571487992386396872019929483632435651843841363763911145491214830299535234589486877117450726227564234782534926099164838764584584225445465866343845542903951896042892196183996131261191374613215744737126418799030382815181353869242297872803629824265647615754775583972247038732012671741922297601040104598248784711051616541267147494974811623595657849962203770617148735385209173732826421676864949431035884636628140394848213539938159665597596913648753502051602241214677518720629211718734907282882891444768218471847257127777759683611681295564327988376142312483585339209446506325728659179278218251678274601835752914687115129690274915392821138259587131444567559072807891134374992090551282952160126318698352171363133829135045171831556160755681292966885173291283233482214984291193669046368479479523382769621181846877528433987962606132929779724949566788712852944754628863778681684020932459589986757558208064624344511967766056821523858120263923327369773413689168157811146577718630689135401650238021219628316491918178749532238353413156437116317140913618797594141183675533149282827223793054674680218737511936382389307290663290881150778421132665544975325628846853802254445099228399184432255895524810778450695181627936254551764884973390549080503649446333408017267267945199766277882795449875669615697039638519728994641830258640596287772566594617247045535549837745611948999392595021458023796541409536463229535643584948656665835071976372869028209675309255985935498423575554552262444661477474729320701119754351648179753615631814547566501558473714746310733872188946293182622161426744156419284487964985471862428191338586885530573814936452663275534420309327233834272543174372419985357789812066312112806162873718766265958941986447657380898946114180631565153989837299382648207653815578554079278492647669955273445016291860405691491494106425761851417382901835848241675054987946831455129094851828614421627868363641269384775838471058964095498172461523965340664287433133676349271141658222243923295681315028167651835346371347487575865796413511747361649286345580191653542869432221275367736863705185906958313642654991582546931537357038837477956231392449422354175694523077957027597857935746318788605436561219177463594539184612734499513142988520952310387372918996225978886599995074721935503874607844951055764065562529223222181260259594365743848038907373961387547715228678476384604041543213463882757536861214891893689871967622667013259243279861692278875561285452721113251241463919436034165076275254972790444874598025471732233217671423805061478531195522907689228955678277273066703642213579442589341158744536772090968056621799716497421863561945114087533012813780213438328950577994139164295130793155517035905119985457545362927527551842976639515587162190447123599165159627438324349370531834182724614922286793946437686886211999486745386526799289188922879289185838103583819355667622917873919632512693596017291915969634348857985738403416652586102213597625825812722947681047757344315793956968992133854470316316192575117947174136663717249332795932637631129631828798774280272974967853382324284683576533991063864911104496371023578739601018598194391878148996977273833926182291182174542537936632473949649450176423779264977119587261145551744188438049242285277084776728499867472194762141766247773890512176583937414260357389318748833634392482119334181080174485619011777762611257985754982563939947483930973321683264976676655686945331817151327611965325524079339628515881197788773122926576279038972421546551773418791399288863141669711254257290411198469558745961579185369578634288661640131226539983338677262714123224495362471181442179587590765939702216117654339628198287287211892078402231833475897074377275989579654993489380209154491693322642331878637280468134735555792988346720224736904815219375599894124298456899911990468780758439191668609982492076596995124341712453742814204726125161774882934363498374664786152242411927619638303571151538608749368219855992588226187068695748461872803469776122963332546044265236736525914335876866386778202064566025432284108761604775483762754772106850806283675449318328357770924249828638701413285763166852745940963576472650986575992874244616552255836463846074159463169234516122373153927183388510106186509775848889244590728790548242846185993170352525446264129113172068501753239152356080912515421844306459904131779626565047944061936435919797528555524487718783189695351840695823605812841181873620753625515297761870988476608754741736885799386896314998257882702077357174702275485766673423147359855426509338367984384848976358197285658457961182278665164147753616789957227754588375283438691956192967735468649594338572541040569640834742699449444556262332866849935140374522783995732931658354325829323831744861397087682819972067683550776976727010373195741053987174894846773788162911777218613988877017692135805770849418157822145586549951336943682435372471978513717065875224392374357431484087619168647281356572923784134794382957921910522484466960978249345735966642807980202516608238492059353514127037303957562451643372576287985419905976463779545581467945219859337079589325149799433728481043705888845973402059325223921967973149955191776555641729731582109042202982802056795981955315653811537164294571781356584860185258394335543849879064653330709723558669778219243517901259861314557878611970156056372088236432646195171129741661384327298165263357753773285813747278696398893736283477633970244094137873479526541163174534963593458917172431179341347695774757667052586210585893788738264516461271106121234762668322583731446120254935363597963730413623818954595983803616749073202925255824535875695441861383429141874515853745536574631849511367177317979316813520174070715742787170579220431688179572312033853410774994346572695512233659789792287722647637699957504650697998901954955117455936651295844186508772486595828891847397968471196695673486678184192192237628719385938237393881551794182988835251239838338587849423905614212339996014553799712747842452375643282010409935849398408946903859748376817338528023863776189294568514212156301951735364886185665058898863552664466958777363993746376814718585435253829481797342329128472350678875204133292038984148585663772914254982309728894377508811398781429951808687162872794628955819254768298143816251136759802458155230296869258463988096926278684274528441102611481893564534972242288637792985974296546081432593665763641297626377503918369055469732233453878525547388236771889354459652995449431765924670175643791577135583802427446247243589134870803061545591485398132991455731383667678924765752122175468746576889265195201046182327625115102637603969318973958380922456399686773038789283794387704048869934953921934728946397173288665412237931581481833863324777632121309896437262508680381340326772607170974771839030408968298612988964402084849338105614129861284879153090269128582072103170745087596759656481483713451911241449652596828487114193875115395192566443734466331895459937399750376679755843506831586390942111361849373595115067237794517595472578307965456067982242739111486624292031468775297862252919199155645013258875399779882165287144736380448349746466162080346981616224843360206751806149764948736314368998298236158259112697381489111919625568474435137715322299407870589399598972963666931614969385289257879280157184685829574454688268895324258281906339276323807549108242995098634330107744286035375379719510802781589414647292274456552513432175801176275444164448362550203534514435766694471963579566381615182742312138267827175579683594719187618176207315821353873661197031693548822280358623186213375636975899239441701093543358236581618730858218309620444416491588541688756059322028374181907443819425384228146026818754328236658058819821122932645760763644629539971087934694418063834942145666689637828668478573645114855679445816481748612452591185997054823187568750777757764769551226572372718477531053152031533877214694851098432575182946246681271448296521745725421343511329194677155235742468616214557390873375988628881315544362952534416424322479159382614738159222185070677467513875921180648962747642702140104845661428595454445941163116501975434657512528749056618879666682353934976893751494372212736414891321516291815649874422454054617332966243803969674532555858932219256223922483992712783483556298558886337553164767178861958362902760763924132927802794191419368095722277312663804213332562168318947980342285511840774059128712454795126828605680283975583251711498583878648522794940362389263354844030706466238771468448399976847298216113802680949273115181151566582856616142278385264689468933203719766566531586858155356753636082169138154589307715647636691974569273734289267589232183943953792098839635225773584572365332792585455040224584677254847728749229823355648388283183786474696496139315571979931095647614593472252552939013764968371696923927496443603583223776793723799667549529719277265619192866393993246529657452524071199050457575643560925776161769368291914518349764571235327775583459977680508652232730185159559719932526172168744539896361587475372350835135701416732942523195279194757188288266124433284420255593714811473980123630988984973789964466492384983645574239342628846514968613623440595521479021597523673214275019668664221625618274389133419546128578864065445276326688472139279170648779939762482163699685802812691763424983266928301044503948872239345442992434449182654099507844429589782923141616969477229727799678491025678635263846813230706632633024162867532897534435801145965838166499638452544019307327842482526465914378898840174295601052899039363987379553628262836954843826703511121863374112796983292482231778991821998379861141919768181617477429498431774344723935861373734285437934726691127485756911178035611557884 diff --git a/inputs/09/test.txt b/inputs/09/test.txt new file mode 100644 index 0000000..5ff5aae --- /dev/null +++ b/inputs/09/test.txt @@ -0,0 +1 @@ +2333133121414131402 \ No newline at end of file diff --git a/solutions/08.zig b/solutions/08.zig index a86d9fe..0d92591 100644 --- a/solutions/08.zig +++ b/solutions/08.zig @@ -251,11 +251,11 @@ fn divide(num: i32, denom: u32) i32 { const expect = std.testing.expect; -// test "part_one" { -// const part_one_response = try part_one(true); -// print("DEBUG - part_one_response is {}\n", .{part_one_response}); -// try expect(part_one_response == 14); -// } +test "part_one" { + const part_one_response = try part_one(true); + print("DEBUG - part_one_response is {}\n", .{part_one_response}); + try expect(part_one_response == 14); +} test "greatest_common_factor" { try expect(gcf(18, 27) == 9); diff --git a/solutions/09.zig b/solutions/09.zig new file mode 100644 index 0000000..beaed93 --- /dev/null +++ b/solutions/09.zig @@ -0,0 +1,197 @@ +const std = @import("std"); +const print = std.debug.print; +const util = @import("util.zig"); + +pub fn main() !void { + const response = try part_two(false); + print("{}\n", .{response}); +} + +// There's _probably_ a super-clever way of doing this without actually expanding out the disk map, using dual-pointers +// and keeping track of how much of each "chunk" has been consumed at each step - but, after thinking it over for a bit, +// I couldn't figure out how to determine when to terminate (i.e. when enough blocks have been moved to make everything +// contiguous), so I'm going for the naive approach - expand out the disk-map, then swap blocks one-by-one. +// +// ...huh, that executed _way_ faster than I feared. +fn part_one(is_test_case: bool) !u64 { + var gpa = std.heap.GeneralPurposeAllocator(.{}){}; + defer _ = gpa.deinit(); + const allocator = gpa.allocator(); + + const input_file = try util.getInputFile("09", is_test_case); + const data = try util.readAllInputWithAllocator(input_file, allocator); + defer allocator.free(data); + + var disk = std.ArrayList(?u32).init(allocator); + defer disk.deinit(); + + var is_in_disk = true; + var disk_id: u32 = 0; + for (data) |c| { + if (c == '\n') { + continue; + } + const count = c - 48; // Why 48? Just because, I guess :shrug: ASCII for `2` is 50, and so... + for (0..count) |_| { + if (is_in_disk) { + try disk.append(disk_id); + } else { + try disk.append(null); + } + } + if (!is_in_disk) { + disk_id += 1; + } + is_in_disk = !is_in_disk; + } + print("DEBUG - actual disk is {any}\n", .{disk.items}); + + // We could _probably_ iterate over the disk from both ends and _just_ sum up the calculated values to get the + // answer (which would be more space-efficient) - but that way I'd have no chance of debugging if something goes + // wrong. I'll instead construct the _actually_ defragged disk, so that I can visually compare it with how it's + // supposed to look. + var left_pointer: usize = 0; + var right_pointer: usize = disk.items.len - 1; + var defragged_disk = std.ArrayList(u32).init(allocator); + defer defragged_disk.deinit(); + while (true) : (left_pointer += 1) { + const value_in_original_disk = disk.items[left_pointer]; + if (value_in_original_disk != null) { + try defragged_disk.append(value_in_original_disk.?); + } else { + // Position of left_pointer is inside a space in the original disk => + // Move the right_pointer left until it finds a block, then insert that into the defragged disk + while (disk.items[right_pointer] == null) { + right_pointer -= 1; + } + try defragged_disk.append(disk.items[right_pointer].?); + right_pointer -= 1; + } + if (right_pointer == left_pointer) { + break; + } + } + print("DEBUG - defragged disk is {any}\n", .{defragged_disk.items}); + + var total: u64 = 0; + var idx: u32 = 0; + while (idx < defragged_disk.items.len) : (idx += 1) { + total += idx * defragged_disk.items[idx]; + } + + return total; +} + +fn part_two(is_test_case: bool) !u64 { + var gpa = std.heap.GeneralPurposeAllocator(.{}){}; + defer _ = gpa.deinit(); + const allocator = gpa.allocator(); + + const input_file = try util.getInputFile("09", is_test_case); + const data = try util.readAllInputWithAllocator(input_file, allocator); + defer allocator.free(data); + + var disk = std.ArrayList(?u32).init(allocator); + defer disk.deinit(); + + var is_in_file = true; + var file_id: u32 = 0; + var file_start_indices = std.AutoHashMap(u32, usize).init(allocator); + defer file_start_indices.deinit(); + // If we wanted, we could probably store "DiskInfo" in a struct and thus in a single HashMap, but...ehhh... + var file_sizes = std.AutoHashMap(u32, usize).init(allocator); + defer file_sizes.deinit(); + for (data) |c| { + if (c == '\n') { + continue; + } + const count = c - 48; // Why 48? Just because, I guess :shrug: ASCII for `2` is 50, and so... + if (is_in_file) { + try file_start_indices.put(file_id, disk.items.len); + } + for (0..count) |_| { + if (is_in_file) { + try disk.append(file_id); + try file_sizes.put(file_id, count); + } else { + try disk.append(null); + } + } + if (!is_in_file) { + file_id += 1; + } + is_in_file = !is_in_file; + } + const highest_file_id = file_id; + print("DEBUG - actual disk is {any}\n", .{disk.items}); + print("DEBUG - highest_file_id is {}\n", .{highest_file_id}); + print("DEBUG - file_start_indices is:\n", .{}); + var it_dsi = file_start_indices.iterator(); + while (it_dsi.next()) |kv| { + print(" {}: {}\n", .{ kv.key_ptr.*, kv.value_ptr.* }); + } + print("DEBUG - file_sizes is:\n", .{}); + var it_ds = file_sizes.iterator(); + while (it_ds.next()) |kv| { + print(" {}: {}\n", .{ kv.key_ptr.*, kv.value_ptr.* }); + } + + // Zig does not support decreasing ranges :'( + // for (highest_file_id..0) |file_id_to_move| { + for (0..highest_file_id) |file_i| { + const file_id_to_move = highest_file_id - file_i; + print("DEBUG - trying to move file with id {}\n", .{file_id_to_move}); + const file_id_as_u32: u32 = @intCast(file_id_to_move); + const original_start_index = file_start_indices.get(file_id_as_u32).?; + const file_size = file_sizes.get(file_id_as_u32).?; + var left_pointer: usize = 0; + // I don't _think_ we can be smarter about jumping forward more than 1 at a time - at least, not without + // returning information from within `hasSpaceToMove`. In particular, we can't jump forward `file_size` - + // consider trying to move a file of size 4 into the following disk: + // X..X....X + // if we jumped forward 4 from index 1, we'd land partway through the following 4-gap, and miss it. + while (left_pointer < original_start_index) : (left_pointer += 1) { + if (hasSpaceToMove(disk, left_pointer, file_size)) { + for (0..file_size) |i| { + disk.items[left_pointer + i] = file_id_as_u32; + disk.items[original_start_index + i] = null; + } + break; + } + } + } + + print("DEBUG - defragged disk is {any}\n", .{disk.items}); + + var total: u64 = 0; + var idx: u32 = 0; + while (idx < disk.items.len) : (idx += 1) { + total += idx * (disk.items[idx] orelse 0); + } + + return total; +} + +fn hasSpaceToMove(disk: std.ArrayList(?u32), pointer: usize, file_size: usize) bool { + for (0..file_size) |i| { + if (disk.items[pointer + i] != null) { + return false; + } + } + print("DEBUG - found space to move - to location {}\n", .{pointer}); + return true; +} + +const expect = std.testing.expect; + +// test "part_one" { +// const part_one_response = try part_one(true); +// print("DEBUG - part_one_response is {}\n", .{part_one_response}); +// try expect(part_one_response == 1928); +// } + +test "part_two" { + const part_two_response = try part_two(true); + print("DEBUG - part_two_response is {}\n", .{part_two_response}); + try expect(part_two_response == 2858); +}