diff --git a/2025/08.rs b/2025/08.rs new file mode 100644 index 0000000..5a4b390 --- /dev/null +++ b/2025/08.rs @@ -0,0 +1,82 @@ +---cargo +[dependencies] +slotmap = "1" +--- + +use slotmap::SlotMap; +use std::collections::HashMap; + +static CONTENT: &'static str = include_str!("./inputs/08_1.txt"); + +fn main() { + let boxes: Vec<(usize, usize, usize)> = CONTENT.lines().map(|l| l.trim()).filter(|l| !l.is_empty()).map(|l| { + let (first, rest) = l.split_once(',').unwrap(); + let (second, third) = rest.split_once(',').unwrap(); + + let first = first.parse::().unwrap(); + let second = second.parse::().unwrap(); + let third = third.parse::().unwrap(); + + (first, second, third) + }).collect(); + + let mut circuits = SlotMap::<_, Vec<(usize, usize, usize)>>::new(); + let mut box_circuits = HashMap::<(usize, usize, usize), slotmap::DefaultKey>::new(); + + println!("Boxes\n{:?}", boxes); + + let mut distances: Vec<_> = boxes.iter() + .flat_map(|s| core::iter::repeat(s).zip(boxes.iter())) + .filter(|(s, t)| s != t) + .filter(|(s, t)| ((s.0.pow(2) + s.1.pow(2) + s.2.pow(2)) as f64).sqrt() < ((t.0.pow(2) + t.1.pow(2) + t.2.pow(2)) as f64).sqrt()) + .map(|(s, t)| (s, t, ((s.0.abs_diff(t.0).pow(2) + s.1.abs_diff(t.1).pow(2) + s.2.abs_diff(t.2).pow(2)) as f64).sqrt())) + .collect(); + distances.sort_by(|(_, _, d1), (_, _, d2)| d2.partial_cmp(d1).unwrap()); + + // println!("Distances\n{:#?}", distances); + + for _ in 0..1000 { + let (first, second, distance) = distances.pop().unwrap(); + println!("Connecting:\n\t{:?} <=> {:?}", first, second); + + let first_circuit = box_circuits.get(first); + let second_circuit = box_circuits.get(second); + println!("\tFirst Circuit: {:?}", first_circuit); + println!("\tSecond Circuit: {:?}", second_circuit); + + match (first_circuit.copied(), second_circuit.copied()) { + (Some(fc), Some(sc)) if fc == sc => {} + (Some(fc), Some(sc)) => { + let second_boxes = circuits.remove(sc).unwrap(); + let first_boxes = circuits.get_mut(fc).unwrap(); + for b in second_boxes { + first_boxes.push(b); + box_circuits.insert(b, fc); + } + }, + (Some(fc), None) => { + circuits.get_mut(fc).unwrap().push(*second); + box_circuits.insert(*second, fc); + }, + (None, Some(sc)) => { + circuits.get_mut(sc).unwrap().push(*first); + box_circuits.insert(*first, sc); + }, + (None, None) => { + let circuit = circuits.insert(vec![*first, *second]); + box_circuits.insert(*first, circuit); + box_circuits.insert(*second, circuit); + + println!("\tCreated Circuit: {:?}", circuit); + } + }; + } + + let mut circuit_list: Vec<_> = circuits.iter().map(|(k, v)| (k, v.len())).collect(); + circuit_list.sort_by_key(|(_, v)| core::cmp::Reverse(*v)); + + println!("Circuits: {:?}", circuit_list); + + let result = circuit_list.iter().take(3).map(|(_, v)| *v).product::(); + println!("Result: {:?}", result); +} diff --git a/2025/inputs/08_1.txt b/2025/inputs/08_1.txt new file mode 100644 index 0000000..ccf1e03 --- /dev/null +++ b/2025/inputs/08_1.txt @@ -0,0 +1,1000 @@ +89590,84247,92413 +31429,76854,36723 +78677,64030,40809 +27833,56570,85542 +45295,90593,4593 +32106,79446,2988 +98228,85411,32502 +6384,42452,67594 +62212,71018,60029 +22450,20415,43757 +48195,83036,12568 +93401,67100,53603 +94662,96707,50094 +2393,5943,48213 +71931,57882,12449 +94624,90036,75502 +90185,82220,95238 +34638,11448,7264 +1190,90750,49827 +95299,40777,37992 +83030,27277,68197 +90593,24806,27364 +27383,13063,42923 +29069,1716,79827 +36946,19662,12462 +23924,32968,5942 +60351,4886,60822 +52084,77754,40696 +78709,68882,69983 +73932,99528,16022 +10398,83696,9307 +49770,22942,82164 +90460,68370,40136 +6326,18603,89416 +87674,4489,71354 +26413,86993,35119 +9212,6554,23316 +18607,82659,5625 +32806,75382,15042 +37742,72928,25548 +68739,72822,54710 +33881,41979,10135 +4258,41840,67432 +85647,49019,6227 +1248,59145,77435 +47727,45191,16011 +29891,25955,35512 +31276,45379,89245 +43326,9923,8736 +74700,53866,18711 +34490,48479,49794 +19028,47570,8453 +98591,56769,10820 +15910,519,50233 +32307,63573,63952 +77884,9954,21578 +44427,18926,30461 +68068,75265,56525 +97713,7612,77161 +58618,81818,98529 +15096,98292,33083 +53703,59870,35215 +20326,91271,52685 +23436,24867,99235 +91525,37689,40791 +37332,92550,70082 +9173,41026,95888 +68546,4939,65358 +8724,95754,26109 +24003,17546,37316 +27953,43813,72169 +87036,40977,83684 +95374,68152,98835 +14530,10693,96771 +37761,43905,96325 +68706,65766,3318 +62989,15745,10845 +21028,47616,71568 +61056,40125,1495 +51540,94685,36739 +1193,51884,49439 +61258,2285,31088 +538,95535,781 +45130,58083,59146 +34538,65433,74361 +40134,98873,37597 +87093,91404,26921 +15300,50680,58298 +88682,78780,5184 +60224,43739,74287 +53439,77949,74382 +69647,6826,25559 +69837,42880,86786 +53936,1921,13691 +44351,21170,59939 +892,66237,19451 +12174,78683,51337 +1256,55489,98612 +63828,47871,58459 +6225,42054,57229 +10074,77604,79616 +46638,51167,23459 +5844,9125,93064 +967,6294,83821 +53731,56740,14991 +94211,60408,19855 +23704,30134,56201 +20568,29986,46559 +91325,28137,45681 +84419,95340,56766 +17062,85614,90179 +60290,42910,39006 +73506,28681,89409 +9330,43884,68994 +82400,32841,52449 +33056,45754,17883 +6965,78344,56687 +34925,62771,78302 +7750,77786,58743 +46210,24010,98340 +74914,92038,51143 +72958,40109,84983 +44494,26044,23376 +63041,84710,79282 +30946,83816,76765 +93574,62265,93182 +55717,42248,73541 +47404,94414,80996 +57375,33446,50933 +33469,82136,16483 +92422,76611,87592 +4788,18231,11153 +4299,63439,79877 +28388,36815,59384 +55373,12100,15883 +62747,97242,35518 +6426,20720,99774 +58302,38101,20450 +53941,92194,67949 +52010,5886,69979 +62581,9498,55163 +18405,5689,41605 +15291,38634,58286 +98453,75588,38440 +69938,61316,8702 +28707,12763,79952 +42085,96834,72790 +49000,78710,44454 +29453,2267,7492 +33547,10616,90297 +77537,19843,62643 +82402,33222,75473 +89955,26051,74934 +63627,22125,32424 +49691,39760,66890 +91737,7998,19151 +20743,61993,30478 +85874,83845,3157 +16854,79030,69771 +29637,98646,98025 +2367,38631,38007 +28550,49386,2806 +81787,27300,85570 +32164,70609,78410 +94510,52556,46122 +73715,79762,84266 +39959,87420,39937 +52494,69399,42451 +81161,17583,57305 +68794,62822,73615 +57339,65591,50702 +52972,15286,19896 +45578,66770,69020 +41013,57574,58373 +64366,14586,57603 +2704,92867,3402 +90456,27555,87156 +49796,20471,95962 +6812,8897,74316 +78782,24749,43483 +77886,73445,63696 +84491,70222,24433 +12005,39830,39116 +60956,66155,66068 +15766,51786,47211 +89377,2557,51854 +33952,24828,84502 +72491,55587,36708 +94754,90745,21174 +60869,4261,43609 +5838,66352,79390 +52112,10694,24826 +76176,36672,4279 +28821,633,18893 +98933,13692,79046 +32879,22028,92935 +25747,69257,85269 +75364,26835,52300 +7308,48104,42948 +61130,97293,47935 +71142,82897,97154 +10744,52238,63535 +15652,54384,4958 +61191,70628,72741 +59325,21399,10362 +71094,29223,70569 +79081,66659,45708 +56184,64238,89461 +89512,65523,48144 +12347,41633,98575 +38493,93912,76581 +486,70760,52670 +72848,21411,30549 +86742,11556,40514 +976,82262,86976 +91142,84800,450 +4257,57687,14101 +22538,90772,84340 +43280,51631,81402 +71901,20482,98615 +45693,22099,65117 +6986,30401,77626 +7312,29405,75892 +59684,1171,51626 +93963,9259,35729 +50770,40181,31338 +83377,72636,80970 +36829,38936,53505 +7406,90909,77129 +96690,29807,51141 +51129,32826,53387 +7793,49358,49574 +71809,92791,46757 +14103,66737,74666 +25081,37544,94534 +3102,84930,40790 +10780,58587,40736 +85746,97209,26608 +34800,84809,39255 +80239,53976,7279 +64049,74570,4269 +67071,4637,37481 +36419,17980,55032 +66862,6620,56419 +29589,98794,58429 +56678,28291,5630 +77496,48936,34486 +79858,73101,18362 +63448,98288,98083 +16396,26891,82175 +20428,58633,51014 +39691,89472,52569 +62505,16528,1993 +81793,49404,83717 +17850,39161,81341 +56030,21575,82051 +88193,83087,90527 +99368,7730,63612 +47683,67594,13862 +52825,28747,6316 +78262,17023,30308 +60636,32634,17615 +74808,66133,27890 +10773,96082,33066 +3913,36205,28256 +944,21130,48897 +53553,6949,77354 +57008,8698,15768 +62694,55057,63405 +21888,46837,48270 +11295,45135,59846 +17163,67273,47120 +15338,63398,55019 +40156,37411,52614 +23139,95248,26185 +47508,23519,74864 +25581,27163,65352 +76615,18210,64742 +63725,21832,50555 +85557,92959,18595 +4953,27596,38325 +71373,58507,55297 +91271,62446,61442 +39259,24777,46107 +94509,66234,8536 +41896,25945,17904 +15780,93193,39776 +88157,42039,42209 +88641,57872,3916 +20276,82932,26172 +36191,36309,44393 +96888,26659,77949 +64049,29343,58815 +95346,32509,690 +7023,81549,83741 +61960,1362,75137 +72906,46905,49811 +8083,13908,58733 +43694,87027,35057 +88519,43789,359 +81537,35341,34811 +71972,43836,3941 +76046,59645,22487 +53961,67089,10026 +34643,95457,86376 +10666,18277,49770 +63553,13911,19134 +80800,76755,78284 +35645,8873,55184 +74996,12418,33542 +43784,23922,86022 +50710,98437,52738 +2777,67239,20452 +51586,10007,8730 +71888,24538,15750 +25502,97630,8312 +70608,21935,95346 +41965,35845,35583 +45456,71889,8201 +46922,34766,71426 +1220,6622,70035 +39940,70038,75092 +91963,32610,79315 +5332,21915,8736 +77633,92956,29380 +86422,64746,21713 +19321,57571,36455 +54807,47059,65625 +14673,45268,61357 +35081,24102,46483 +11508,86029,51434 +8244,84232,77594 +15494,6578,34254 +23838,17390,16594 +56996,76409,16606 +37133,11691,95607 +62722,81606,22373 +50834,81872,79743 +67203,31326,83379 +85598,62980,76903 +84659,54929,81548 +88211,3395,63566 +13562,67854,95015 +62776,58170,13086 +13472,59384,45790 +1795,94449,21027 +46336,24579,36058 +19891,23828,44394 +23568,73173,36924 +52911,86022,23153 +65988,20046,15153 +33573,53180,44618 +35638,98180,50717 +43581,12612,49207 +81927,12360,72703 +82587,73527,36500 +11756,48417,29458 +85817,61491,81919 +95648,16553,92414 +15806,40765,98693 +77574,39825,24817 +67641,25699,79471 +90759,28954,89701 +1757,33995,68141 +52543,21825,41767 +94705,4500,56551 +54748,80107,29662 +28468,62904,96493 +73140,70037,78603 +79244,30169,70976 +23768,88287,82995 +82716,61892,36086 +67843,78872,7447 +54069,21872,29594 +57464,42541,86389 +93687,35976,64672 +7591,54413,90055 +14751,18035,13747 +65136,90438,21480 +32820,51220,93176 +69398,32138,84890 +49202,70761,89398 +14421,3866,36842 +42296,56778,76302 +31888,92042,61220 +41072,88329,35765 +30218,13539,94534 +33814,65448,80700 +74360,44881,5955 +27375,34267,67197 +3833,36486,46604 +89484,56761,83200 +90837,38580,48764 +26404,69650,71265 +73055,22101,18591 +81834,51706,25477 +8612,21892,74201 +9307,5661,69011 +44228,42969,63331 +51850,15065,49411 +29426,83470,67693 +76907,98547,65727 +21760,92430,27118 +76156,92382,66927 +88617,6674,10575 +86897,12537,89289 +2126,87624,55240 +67851,79671,71457 +62489,83371,1492 +98931,27143,61930 +14461,34808,29880 +83224,49168,97463 +91788,71002,14425 +15312,14307,66657 +33367,93340,40879 +8790,31680,56254 +35559,55424,82921 +70708,33853,14610 +9735,80480,10587 +32263,51193,76965 +16491,64266,24646 +99004,30340,125 +19012,25663,35411 +26917,60185,22193 +69256,20079,37541 +91118,83454,18910 +93636,99277,37276 +12944,72339,18954 +95813,5688,29506 +72163,1884,86333 +15791,76093,92264 +81093,94673,92911 +66045,53606,6716 +16223,26972,9751 +431,20780,86761 +44107,33145,42223 +64053,52644,84347 +84296,58565,65127 +97069,5844,44497 +8671,68090,66642 +66443,65180,88465 +96659,47960,95599 +6024,48476,33460 +65454,49942,37299 +81632,62779,53899 +21319,49800,71733 +13098,20018,47574 +74848,56888,66796 +71979,52601,52965 +90864,49785,30862 +41885,82231,23679 +71410,37926,12007 +2777,86419,299 +21499,12916,89274 +49026,10237,94509 +27750,64402,11552 +4236,14264,4835 +50217,38314,6192 +12867,99638,49124 +58011,55834,54755 +20758,79077,89216 +84001,83033,75095 +5786,31177,15432 +18779,80756,81733 +43214,2856,76565 +52835,86220,45496 +84867,91439,47966 +89711,57726,87837 +47883,11370,84623 +15524,4981,98572 +72321,63286,86600 +13575,66304,17140 +84104,98607,46516 +2622,68671,42276 +37668,237,98179 +13423,92080,76125 +81633,75690,47719 +17642,84527,76588 +98076,60171,58813 +18959,66248,31741 +69188,56520,80856 +9546,35697,46134 +54548,75064,26225 +51857,59986,8940 +74487,45304,47499 +83994,15169,25775 +11761,84671,71820 +85739,71581,7775 +91150,43076,1693 +25773,33875,22902 +43429,27163,34277 +97446,12684,84743 +62941,32266,29148 +52308,37497,67913 +66573,2613,50032 +16111,95923,7808 +25525,23324,83280 +30378,9218,58819 +54311,54421,51275 +1602,34036,99463 +21105,15648,72132 +41526,30851,26533 +22977,27530,75243 +7573,39052,32170 +33279,89018,74854 +32773,14244,60505 +74670,93446,36994 +12016,15698,69817 +85980,71049,2362 +98916,1508,38795 +7960,93349,4518 +2920,56107,46958 +79734,32663,42018 +1831,5242,18242 +48231,59129,14127 +52992,91874,12977 +55171,26199,2186 +86068,18092,77145 +14434,75077,45551 +87814,46465,14898 +43044,70833,9008 +23853,50544,50134 +73218,41786,71054 +70437,56471,53200 +83215,95684,88282 +46026,53184,30028 +25995,79997,17998 +83793,18135,77905 +34417,3064,71322 +48112,77422,29214 +93658,51614,67533 +74189,38308,34769 +152,10451,608 +16602,20298,30073 +70720,93682,17207 +25310,72358,66008 +23032,59876,32319 +93633,63778,14403 +1730,29211,86931 +5769,59747,88622 +45107,54667,65621 +87009,47405,41757 +23034,86323,56680 +51298,45192,98291 +65201,31338,59448 +20431,79242,11987 +39424,50693,27529 +48869,53919,63878 +36479,2178,28397 +84847,65444,97311 +16646,73353,40561 +40644,14373,44446 +60259,19382,61576 +33949,32152,56197 +88507,33356,31448 +44393,79852,10658 +86293,1018,75065 +43922,63168,97922 +24463,49599,38810 +41451,12311,33557 +78176,95900,60019 +37734,33516,30932 +12651,92898,624 +21720,82344,5394 +52302,48303,14262 +71659,53375,64865 +3126,99023,82779 +1975,60445,39221 +95678,26224,59988 +54806,11237,1979 +25527,31762,89061 +83177,56765,94692 +84122,52421,60975 +45942,41143,26936 +96155,35346,95397 +62761,71438,23212 +98198,19815,59657 +52175,38037,50684 +80908,22047,8617 +58546,22933,20390 +4586,36760,90310 +6734,46286,71212 +68718,62955,33830 +11660,59575,90839 +65451,20026,73925 +71342,78517,90375 +69584,61057,56734 +29918,2761,29114 +12491,54731,32427 +72880,87787,13809 +33490,60709,4698 +25378,21929,53363 +41426,19397,82905 +48168,62242,97575 +90753,68252,9127 +79462,69592,7080 +84962,21219,25154 +10809,58408,7918 +74780,89713,80001 +4899,63992,47916 +68880,47238,17865 +88052,56398,76232 +74747,15396,23662 +39369,62586,42384 +56937,36255,35950 +88909,50350,61893 +9453,22112,87343 +4358,22870,69457 +28912,43928,10108 +34645,71335,62084 +31272,13179,22603 +52170,60209,35467 +94170,69024,2630 +4015,42426,16452 +88746,57937,96976 +42112,33489,14785 +25683,46333,63834 +54878,49552,60845 +61474,27280,94756 +75500,77653,45686 +60217,85237,20960 +85266,63620,59132 +56525,92478,77920 +50755,52523,35567 +76373,40858,66044 +86693,3998,35083 +32045,71919,94686 +622,45720,13613 +58811,75230,57667 +33877,99155,92468 +12770,76421,41956 +33345,82178,20513 +3703,83808,35242 +41264,38422,98675 +98658,43217,34697 +10878,73833,89796 +44883,3366,20150 +86321,75158,37791 +15574,58261,58357 +79241,26545,88632 +43335,54655,10190 +10550,60190,6535 +62498,91375,80350 +165,56146,65571 +78978,28651,72518 +97929,82210,97984 +54976,69295,2877 +96436,88844,37614 +21659,86819,31992 +10529,93663,54602 +75691,77067,67291 +92992,45742,48038 +8830,71734,59292 +93570,74615,78477 +23521,95255,56809 +19720,2200,36083 +19141,46995,28311 +78030,7471,28430 +12429,51814,65149 +6161,83710,40764 +55039,77151,13255 +48837,15414,64589 +57745,26745,83886 +35534,37902,98528 +66961,89467,33873 +99625,18946,33684 +54826,55577,5859 +62299,78076,4700 +51993,23614,73937 +87819,10035,48372 +44630,91033,22629 +92328,31862,63374 +93340,38946,49932 +28463,98519,664 +5222,38307,16296 +43303,51342,54915 +24523,9405,9982 +20222,1180,82549 +34754,61507,94598 +3458,50744,37415 +64144,78229,61618 +72090,97976,37886 +416,67913,42363 +21211,23032,60481 +36780,97989,41249 +69423,24178,23906 +65094,24379,65686 +60207,50687,50694 +18428,21528,23560 +97813,46092,26803 +86173,96406,85893 +66445,60081,25039 +39685,57047,59030 +11878,84589,99359 +55047,33821,94385 +30587,29307,33860 +81081,4713,13505 +32215,99704,38757 +47703,2769,65455 +5695,55634,63959 +57167,20990,68357 +53163,84802,77184 +88613,21747,80765 +4975,59455,80534 +98518,38212,86524 +14160,19806,310 +20009,59380,50178 +9497,62856,44316 +27117,77122,70586 +20043,45404,86140 +6162,86071,79259 +33523,23413,39949 +22885,80750,63647 +37084,92187,18702 +52942,68647,6588 +38038,99695,87152 +65782,32157,81879 +85430,31200,8409 +26783,64905,33705 +63703,69605,83379 +39985,95065,4745 +16301,91243,73837 +40012,84254,64472 +56852,31046,24309 +23127,39493,14052 +14996,8784,57348 +99461,748,55710 +6337,18570,18430 +77921,99674,87497 +68468,13534,95491 +27533,28337,8930 +75981,43932,4891 +68920,9961,54316 +12164,86653,90807 +86979,36344,35101 +73965,54455,73442 +51642,88277,90912 +56800,68306,17086 +17120,10347,36781 +24529,34343,94210 +12320,84270,20518 +46892,1362,78821 +6929,63075,40188 +12692,1569,88852 +66537,89455,22918 +22772,22086,66879 +43373,7811,94508 +33916,69739,7769 +75795,64705,15376 +23610,95279,46595 +27735,8074,36805 +58501,10588,37994 +89449,81999,33201 +56073,18743,57987 +11825,70403,3271 +86514,21025,19395 +21656,94642,84647 +60612,23068,37600 +75527,8487,85613 +30795,38537,32341 +90129,45732,38498 +82349,80151,10926 +91426,71971,76141 +66284,37544,99819 +16962,24836,87395 +49934,80380,67133 +29502,468,45583 +60139,14151,57948 +73015,35627,86694 +54850,9922,25187 +76320,12587,42859 +13350,41869,36032 +13599,14203,66477 +73601,45719,33245 +27595,98985,17214 +29599,3478,10922 +2988,30753,24453 +71724,14061,23733 +33069,5843,86570 +92863,85117,438 +52884,49131,40006 +11206,33716,92647 +48241,409,69420 +24941,22910,68869 +89599,74186,12638 +25821,84464,94862 +7852,68840,85013 +45183,82379,3682 +89186,22534,5761 +85003,23275,91131 +42926,22904,76312 +49662,32986,8245 +26375,83326,2631 +62739,86134,3462 +64771,86919,71081 +2389,26824,88348 +27193,33919,92058 +64673,36274,9919 +57717,12245,63955 +14536,59935,59561 +96299,34487,67034 +47243,71515,85990 +97456,11789,406 +56392,18630,81066 +56395,36770,39607 +65266,28421,86271 +28679,70466,69233 +70793,91515,73631 +41073,58922,24352 +60992,89876,33617 +87459,37519,49669 +5571,18409,87474 +86598,14356,25368 +36788,99855,56236 +26704,85463,17255 +42758,50019,58991 +89152,61939,23883 +36103,84784,1523 +84222,56973,59145 +11070,20477,79658 +27581,72152,9003 +47239,826,88004 +26253,40770,70035 +79456,55031,2957 +78670,38666,46452 +55359,10731,96094 +88665,8199,30484 +26014,16956,25686 +53010,79849,4732 +74752,15873,49582 +22787,53421,76083 +31667,86938,83468 +22315,68297,18867 +15878,76616,71945 +79359,56753,52355 +1845,49863,84229 +33078,20152,10544 +16542,70625,50027 +9345,69378,58114 +28589,25589,32985 +85201,61813,87592 +21030,7852,64955 +10926,23079,74209 +6225,32101,98670 +11238,60340,41541 +15603,45678,45707 +85140,79257,67424 +65811,34657,27437 +7826,58787,13500 +267,86399,60098 +24137,39947,25767 +27988,95387,78099 +64354,82804,81037 +14923,66466,38603 +88725,27064,58022 +37798,64848,54537 +15285,36399,74436 +53428,35211,83555 +29670,7439,40530 +65979,35692,62608 +52501,1138,37755 +30083,17264,66435 +39020,58528,99379 +98068,41538,66948 +22356,42308,65082 +35354,27822,87939 +97579,48419,93479 +79800,65903,572 +5424,16134,26371 +61885,97937,47210 +25416,34789,63193 +45354,29033,32502 +51997,2118,37240 +9076,12317,40110 +41876,91069,17746 +85033,41688,70632 +34985,65837,88616 +57938,43832,18304 +20723,91573,19888 +88532,9183,22981 +98388,29045,54564 +25179,75117,70853 +58294,96698,49558 +41887,42152,4286 +47378,95487,17106 +18174,59299,54985 +14373,72479,25728 +72060,89419,31829 +69528,21091,23700 +60290,10527,17 +60337,86899,76163 +4346,76843,5836 +83816,66585,79679 +70969,6241,73072 +88008,72157,26062 +56350,95101,62143 +31990,85989,36922 +553,73140,14239 +63887,44116,74737 +25219,63797,84589 +57616,40190,27423 +16779,60010,28241 +17939,76780,96254 +98804,82954,40131 +31383,64476,61406 +85440,62061,79346 +34219,9201,10254 +53721,22774,36352 +41510,91277,94463 +87281,19187,58313 +11169,9081,9539 +1475,33267,68295 +35240,97872,70043 +81202,47379,2690 +55675,23179,11094 +27357,51200,41203 +16744,54635,88762 +80893,77762,64195 +10864,2616,25225 +87644,29333,78561 +76671,39867,65178 +45930,38147,33572 +99526,9473,90855 +96291,99603,91876 +40659,88934,3333 +82593,45127,8053 +86954,27386,30528 +21241,76261,82662 +23289,87749,32201 +63776,26850,1043 +72936,86099,6820 +23666,28649,5706 +12827,79454,42882 +44677,73913,6448 +79752,48912,91794 +33715,3507,96267 +10383,24648,13574 +5008,24826,71817 +31072,99984,74625 +47761,92753,72338 +35547,21326,55411 +21623,27726,69747 +1901,33375,13186 +27189,62191,14558 +86721,56098,76402 +61153,18435,48722 +77731,51129,84174 +23097,21938,59940 +98345,76839,35695 +62335,48610,46275 +89256,2415,16216 +76024,75671,44928 +19160,805,23534 +68181,12006,12157 +44929,27200,67306 +63596,75715,95511 +9587,22767,55608 +25731,52229,39140 +19938,74129,33449 +49058,70900,49840 +47143,59616,26253 +66384,5100,29155 +92751,74015,6964 +61145,6837,84177 +34065,20359,66095 +75466,83975,10570 +94830,41241,19854 +50377,77397,36606 +62197,10740,95860 +72718,29357,98013 +9245,14110,2286 +97099,82710,88037 +8689,2974,30112 +20891,14093,60854 +53223,70422,94435 +12532,43395,29141 +60756,2379,93193 +96662,27163,94903 +47645,2893,745 +55767,96945,63277 +20336,28986,78950 +48379,50454,29669 +63481,97068,19249 +73497,24858,7271 +87879,59673,36690 +43953,32398,54457 +69978,97047,31877 +89124,30351,80468 +92483,94703,63453 +63450,14811,45024 +36148,71035,79037 +75742,21773,96888 +96400,93491,23090 +27521,37283,71625 +12208,90726,79400 +20105,30468,93901 +50793,56106,91438 +71666,59859,29687 +55675,42850,79028 +42495,80694,99182 diff --git a/2025/inputs/08_example.txt b/2025/inputs/08_example.txt new file mode 100644 index 0000000..e98a3b6 --- /dev/null +++ b/2025/inputs/08_example.txt @@ -0,0 +1,20 @@ +162,817,812 +57,618,57 +906,360,560 +592,479,940 +352,342,300 +466,668,158 +542,29,236 +431,825,988 +739,650,466 +52,470,668 +216,146,977 +819,987,18 +117,168,530 +805,96,715 +346,949,466 +970,615,88 +941,993,340 +862,61,35 +984,92,344 +425,690,689