From b9ee2a8f249dae67ae091d4d13dd26ee7cbaa418 Mon Sep 17 00:00:00 2001 From: xoyz Date: Fri, 5 Dec 2025 17:13:57 +0100 Subject: [PATCH 1/2] feat: Day 05 part 01 --- src/2025/day-05/python/xoyz69/.python-version | 1 + src/2025/day-05/python/xoyz69/README.md | 0 src/2025/day-05/python/xoyz69/input | 1191 +++++++++++++++++ src/2025/day-05/python/xoyz69/main.py | 37 + src/2025/day-05/python/xoyz69/pyproject.toml | 9 + src/2025/day-05/python/xoyz69/uv.lock | 40 + 6 files changed, 1278 insertions(+) create mode 100644 src/2025/day-05/python/xoyz69/.python-version create mode 100644 src/2025/day-05/python/xoyz69/README.md create mode 100644 src/2025/day-05/python/xoyz69/input create mode 100644 src/2025/day-05/python/xoyz69/main.py create mode 100644 src/2025/day-05/python/xoyz69/pyproject.toml create mode 100644 src/2025/day-05/python/xoyz69/uv.lock diff --git a/src/2025/day-05/python/xoyz69/.python-version b/src/2025/day-05/python/xoyz69/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/src/2025/day-05/python/xoyz69/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/src/2025/day-05/python/xoyz69/README.md b/src/2025/day-05/python/xoyz69/README.md new file mode 100644 index 0000000..e69de29 diff --git a/src/2025/day-05/python/xoyz69/input b/src/2025/day-05/python/xoyz69/input new file mode 100644 index 0000000..4093acf --- /dev/null +++ b/src/2025/day-05/python/xoyz69/input @@ -0,0 +1,1191 @@ +527028483603237-530596046705806 +231611686269733-232830228664181 +75475032395596-76960084164171 +203839219483157-205309276440608 +50899806602568-58580276960637 +348023446284659-349432400960533 +99300079175333-99300079175333 +243603050472076-244121129344428 +215608453928184-218347151677708 +559603756857369-560747959347574 +357973561889555-361367389958275 +153034818227400-159360207888955 +502733798128162-503279006301491 +323013740729363-323381915985523 +527028483603237-530596046705806 +61641386395983-67021230322014 +91024067485337-99300079175333 +232449072996959-234097971321113 +148783445784670-148783445784670 +15833326205797-17418339643302 +505605330381036-506207894991252 +112602413285185-119326613429128 +123946485247056-129469892544921 +137167742337992-137324020583710 +511152287424346-511253380025377 +246461419852156-247170936427773 +504676621204473-505026491432594 +510534926915260-510900675620171 +234587388109332-235821545099396 +329912182745310-330381374217602 +73828954111068-75232756067163 +135752935675329-136378697282213 +496191249922313-501122630801934 +133979736497382-134764106087904 +252104186307035-257089307127655 +504302623647034-505026491432594 +76526080063341-78067653480180 +133979736497382-134654293556154 +558677362576826-560155745642088 +74524948975609-76105959782870 +235635330848985-237191841329135 +541917811955625-541917811955625 +119326613429129-119326613429129 +553872392553945-555266156778988 +366414367343123-371371164109127 +345992126286124-347761851238364 +133286158975157-133979736497382 +505178666516591-505853679404368 +385779390535182-389543666687966 +136893495537949-137167742337992 +327348264387941-327866800676191 +131664742722233-132008978697672 +516853543506548-521402105555623 +354383952572690-357973561889554 +82739490947292-89017889386605 +552959255039459-554658031622118 +342031782279918-343652907746898 +508484714248278-508961054793712 +237519915568507-239145977273580 +507770887945018-508484714248278 +343907345660132-345606200241766 +483916138291259-490404769570928 +464852542067488-467203292140343 +77632426688474-79114482043408 +442834205538352-447108362422934 +403656227860835-403656227860835 +246461419852156-247170936427773 +222613372587062-226711219326389 +325646224334292-326081258515740 +273530143840563-280932638034120 +2020409498513-6492182236039 +239362201739794-240956508377631 +103697640811728-103697640811728 +464852542067488-471273807149096 +137784042454372-138569267642138 +556942026237883-558021643102410 +250248951956584-250773157158356 +508484714248278-508961054793712 +329912182745310-330381374217602 +247170936427773-247866876325266 +438390869383638-441208567253203 +166867276405365-169858552714393 +317448008624870-317448008624870 +131664742722233-132343845539301 +322876735023384-323487090592579 +557866275687601-559015258148801 +262675114041629-270790651126896 +413510315014473-420007769205209 +242471956463321-242597321380948 +521402105555623-521402105555623 +243603050472076-244341783051255 +142132531346043-148783445784670 +131282276978058-131864946681032 +453739749815969-459023513536430 +415465248953494-418338269312101 +435010996678516-438390869383637 +245241776827571-245413024187675 +218347151677709-218347151677709 +374162092970043-377611071422835 +504302623647034-504519885344972 +34077459182861-39777947758526 +26392981832048-27184361782686 +455640553554951-461195813672932 +537068214024169-541917811955624 +376155658293602-380858986836400 +82739490947292-84836363036474 +397748480001034-397748480001034 +136893495537949-137628729613168 +507326835905711-508025842388742 +324922873483849-325166493618721 +195435929723019-200695398398917 +41749006858622-45856980801485 +78785040359990-80030288498488 +134261966072861-135110609174502 +385779390535182-389543666687966 +262675114041629-262675114041629 +163457238066213-166867276405364 +544396384414554-551941721325111 +403656227860836-408398229161489 +70475724803704-71997715360766 +41749006858622-45856980801485 +20753943053572-27184361782686 +103697640811728-109322877986643 +504302623647034-504519885344972 +53498304611067-55771266424594 +181598181282532-190696236439008 +136031474719714-136893495537949 +140020791580455-140400459583434 +305187053481863-310519894847258 +283722612347495-288529460316528 +324576992288902-325400357860404 +335780791417434-340717141451355 +135273702699110-136031474719714 +321885261062598-322500760215531 +2020409498512-2020409498512 +247635420618152-248168741920366 +10809942857493-15833326205796 +244999949675850-245241776827571 +122420293179842-126572678076742 +346979435906074-348658916848459 +473454317579521-481021223255510 +252104186307035-257089307127655 +332441272969558-335780791417432 +426124866409633-429906562980455 +249600206770349-249922379246403 +248986021389910-249359585895003 +561261795684072-562841287225609 +393079650593881-397748480001033 +185652825479208-187119812414873 +173953027389372-179515478581254 +327561022376665-328177748368301 +349945753303336-351545827340308 +236387775465212-238197708561329 +233299681147638-235054475210142 +244999949675850-245697091078303 +560605314311115-561930684727783 +238631856949366-239910573540071 +364741905307008-371371164109127 +243856713965175-244121129344428 +247479120838145-247635420618152 +31917117922914-34077459182859 +292145500212003-292145500212003 +511832090589807-512338970187689 +447108362422936-449629160130141 +424346163029900-429906562980455 +509344387593849-509861907786160 +344929686478190-346606734251988 +314266885205282-317448008624870 +349204609735176-350596934361940 +555687085700713-557093789144241 +133614070485386-133979736497382 +473454317579521-473454317579521 +226711219326391-230643027991650 +276637728866547-280932638034120 +342988184222313-344614607589202 +292145500212003-297719133030350 +133168028889494-133747912047206 +504302623647034-504519885344972 +135752935675329-136562658228344 +203839219483157-209702986145200 +134654293556154-134764106087904 +173953027389371-173953027389371 +544396384414553-544396384414553 +72610827321812-74139327712477 +506207894991252-507105474607917 +555061918895904-556176843887873 +192711220582644-196555681976860 +283722612347495-287505783920120 +71476667916353-73009555122235 +486150733366819-488568724471762 + +333238176511983 +485689992458747 +549508264451078 +33431507780279 +559802145764979 +233626241952600 +561293064269704 +54611723120308 +329927376327474 +316432132471650 +176408968598599 +302590848025064 +225404480754421 +355943937692688 +230512904598418 +12363346143090 +114741821575203 +425585306430426 +105794541748033 +63204897129359 +480220099502638 +369559694173945 +259794609697498 +394919482126261 +95343838552578 +377064693071571 +387553021361688 +54165960451051 +68847393049220 +518843425882193 +159107953851712 +217221319851440 +315392797785894 +143344047650409 +227727688557414 +29324798738189 +44649229613259 +287908262819671 +23893469383317 +71604573428899 +291974862345939 +386022920727495 +184607106234930 +15285701743385 +339990086631368 +91375408336743 +367255925551385 +78174550889769 +152713653148877 +6019989324296 +181256493811438 +83045077581486 +491015280526305 +414912747557253 +414065279294813 +275373389496166 +21661434284885 +496416852297839 +477494791955461 +327602736217782 +138880747979879 +271480550392019 +158160500147986 +22359716987517 +414576689092834 +305803184784229 +65692053784284 +360173762583092 +458128731749150 +378315157016904 +198233403051772 +52327402075788 +459496109629835 +48860372473025 +454257819227706 +97472804550722 +502964175459770 +459100485158840 +131796816478263 +495898100350915 +509758287149052 +554302977506672 +141460841946747 +368399402770221 +144833542575552 +459257396837051 +128897248295935 +94684258795493 +517185225146550 +353038510608703 +438915863504618 +44729354181035 +274623254066270 +77767089952860 +199443030693887 +245599182009338 +513597666643845 +548898983360812 +168833181122479 +108599615430535 +267323690512525 +478748932732586 +418044899650582 +438723699239049 +377021028407774 +521243413249980 +186372087298993 +177696180629499 +424607798783136 +175043083959588 +71542085709966 +122881136856443 +53642445871607 +55983883980568 +307482918699313 +548034266877241 +107443352691469 +308944791230750 +336435445141577 +18349719491670 +448205670457427 +71542585287717 +408033037307226 +480102956094501 +420109993028969 +395424521350835 +185379878797077 +203710057829105 +36557592044669 +551870675458765 +546868807269922 +504793474214081 +66889203140506 +277358386195352 +154658725086261 +458710471506147 +140063001204899 +554589123545113 +187764639288738 +280805527975913 +458767928415331 +327562713156083 +227404441777348 +58510480179466 +288486494720799 +63237257198643 +448172041690679 +42280135521746 +192789521352439 +156869200380410 +333308827586207 +168770744819228 +206756346672463 +445490948585152 +558298887368719 +41757079751796 +123233680453554 +101710668548164 +293051383933234 +462115775599059 +156790852024775 +42146634104362 +529361812764217 +375031732026888 +361654048249706 +556482382871481 +438952718905184 +195800957172995 +447685099105065 +3167800942342 +208897665420647 +315160556343878 +345884001759232 +122757578730601 +126844669879576 +286578117506275 +559076784806808 +133183790416412 +424801834309423 +224969252327364 +374350766089642 +20798997670184 +289417380274906 +184315518776518 +371292335190090 +114582339644698 +208127482443002 +279570456318369 +477243481897708 +137615434402227 +155587329960576 +66058404247566 +6009626878305 +467744254435927 +247816923962984 +261599002789618 +297502156271657 +506808816995009 +545665721143573 +147717106107093 +4012198244055 +148435918998957 +246749347260119 +239376349150393 +227276111047012 +364636121327145 +517935259795945 +474439763479168 +43520261515585 +280856775504394 +75286142706624 +131996546479158 +86881586573971 +508673411390645 +250812186729577 +423847559969065 +223713790582714 +546169006985788 +315891576181866 +489122094481310 +475976446227767 +154259526095214 +128476226213058 +503015859091746 +334986513955732 +75578041521823 +411249026105852 +6961569038731 +530192246099700 +446871809147527 +277602939775284 +258190499459374 +539417674939313 +478261671944180 +165763609730570 +117972782963073 +469561640920263 +120202048183618 +422630678791095 +524898844581346 +294638145309687 +254396332912069 +56492904870038 +181323276371441 +24563499850507 +205865074842223 +148409995925774 +395905756559261 +246720675862029 +66613251955864 +54321217823722 +83363680130035 +31331826491519 +369263420444315 +153585492077154 +26955824861402 +22181157571828 +33780712543998 +56160872499578 +390901897324810 +438758055522387 +83723410127998 +239700116295950 +10986346065127 +21616081875381 +183162530553635 +423092070823128 +166301878995476 +369306563784273 +16879629962184 +560571735506509 +387532639382396 +458507186052187 +42069097096577 +259593097594975 +310058462635834 +299871431824265 +16082780296802 +296509123823706 +310711658803761 +295331711956231 +263735055537003 +352432028729091 +126398905211847 +519658672816043 +280192070333888 +95167114311387 +7724622964718 +369059413707853 +407224185915014 +157210350166793 +487514577914260 +98252950133724 +440363069543446 +417429307246762 +405604516492090 +265092074416263 +126664645818342 +113579085457754 +75905498316434 +302354855339641 +59102049425656 +280130340136360 +478494650079721 +264501498508817 +116663854295906 +284135376096844 +57339172396252 +125908990581492 +218698452226404 +479066189543047 +193992192301764 +26935168322503 +371050124007331 +444128611785680 +54655542495528 +556257788880115 +156109812323271 +405143694880279 +355947553028693 +279181834119431 +417842173912253 +475447264397728 +55724984827730 +425808365149730 +168849060821640 +156207061705977 +131293018861777 +397742035837384 +96457963600273 +46367169863551 +337263087738255 +394915248600831 +444461394522373 +517303468399826 +429667661403856 +196126205904706 +345645786967901 +395094838057755 +2454513324534 +10669231861146 +181653878244795 +5371429552757 +437239845288438 +305253685206642 +397782367989380 +116070532783845 +360208932753546 +386395002336574 +518479266388798 +479470049286739 +245213360203745 +544805559539410 +339066959466973 +469022935378584 +79584652573505 +312843271512692 +134384452340553 +178327648734890 +306022231371999 +3032700546010 +233699956073485 +135215114494364 +219224396779922 +113845604633989 +34093972860838 +194782165353201 +499416593344766 +255174640655237 +402958518901791 +265739275480141 +25292455870054 +276724600410563 +355997692469246 +457676611759223 +386047176287638 +190039724559619 +518280416553328 +445079132020583 +366751170462266 +498555774054597 +72048936868320 +342497936372764 +361252126585596 +327840502439476 +438315420764905 +377653416678653 +306791029781783 +143098032488114 +489451109209073 +77885509362987 +6821213007110 +440638166411650 +132088062077987 +380565217714357 +206441957599982 +230445944085264 +294544923364596 +550955891098415 +14814329045909 +350660806006538 +350789312113174 +285443827330665 +228446679627565 +58280132644935 +77497961379779 +284718621487764 +91583410841066 +240711774586230 +307371626015792 +360341200112712 +560878863073836 +234408108815672 +217929533512520 +380949194277822 +181962520261892 +540232704378619 +555280853519688 +339599056777540 +253331530299096 +246432668510514 +239485570722378 +380450561320510 +225753113308679 +117381802211798 +374882327903152 +108651606868446 +196944808288008 +356898895235334 +468918539568103 +269570725731051 +95733154606750 +56777936035388 +223730424738654 +446335891855758 +365975701734335 +135691958743519 +242613950355869 +339761933169496 +554172216673937 +376099942871301 +218193986422737 +186286494218132 +15542487103388 +413998674312200 +55662990646422 +527419095668533 +371551454668194 +93282723288280 +57611056990687 +38801274595908 +465669027392228 +478172714532509 +321798249758777 +562462072531947 +27173249223386 +541338226718552 +510833718417249 +459293257919227 +2578180288392 +208664979169711 +84166930707618 +500435517139878 +562907926846899 +517735411417109 +179409781136024 +34898720974673 +284923768208670 +157983270022598 +153131433816426 +18393721953180 +316322152660920 +22355375605940 +397246603329883 +554967036051278 +497281145240675 +247656977357763 +453922640286096 +145221535272945 +34772548877377 +377385228995380 +488414668953237 +560545999900166 +397718924038897 +480127998411675 +112984100991634 +240894109209186 +485722350510848 +43371763020897 +558269615993025 +215754841367985 +390164427363240 +14732406523558 +236009002762192 +174342432125225 +255463600507178 +395182843721300 +342602554208911 +528507951564388 +241875347976305 +113957535730919 +216559962572878 +182415070955063 +163985599290058 +371001440724072 +15272810587403 +193319822867177 +556343558336378 +179109223017207 +415127953575123 +297848316250039 +392671541548341 +405304458530244 +274714701484250 +15049178690632 +338480856292885 +286625209351685 +425366337053578 +448545315533944 +541900814421204 +256913769690019 +288429342353686 +228318984823114 +527126883649505 +484801026677458 +133951108335060 +529472005696509 +59700611717831 +487761375293315 +447035565574216 +317155237736864 +397547052933411 +275596068169327 +512302379205978 +205693522964636 +379891574363121 +365896673931096 +328804216175169 +200216131738280 +302825641282669 +473502552425839 +66958058021682 +51269372537828 +500921134113309 +103962306584888 +539336505275948 +117286064994115 +172772484112629 +239759022413835 +521095052346700 +454776741466267 +447066658605720 +547255227253350 +304963494744784 +289560800497618 +316501300548757 +479086400557057 +95326786124590 +140968225791906 +115072271879595 +7234969939639 +482956881124572 +183466145923095 +235393384642509 +62406042864843 +400707058435945 +503105276932101 +357566027207386 +148521846514124 +275750878909114 +339370667768190 +127048273590265 +458527823927160 +97444273980082 +16182985223411 +213183555533691 +45309658270905 +403839396039789 +466098726186136 +106643286670766 +38176877510118 +198314756910366 +346517497511178 +205928624831403 +222864314271686 +251640741435146 +407508376987872 +92519113502818 +407317720738958 +175305340425784 +476620889550377 +87305299787417 +444545756281778 +404518714951703 +555409238703627 +251797579995822 +255256702255660 +176681045179075 +77481671334174 +116544169170029 +444122536639737 +389103049935920 +498748642522853 +3873265377540 +98050617645202 +116322321801355 +226367094720147 +485075143875541 +242573360392439 +71795567210757 +476601047034728 +508048526398655 +159198298530093 +216436956386224 +345416699145181 +90380860243029 +253472698754537 +83400513334807 +427310261563924 +69822171498753 +559842914094152 +459287725352528 +243613041158610 +10991341630189 +228807721663261 +7024115782429 +267146826788972 +338032239059017 +289546948436021 +35124843837602 +394075516816769 +268803645511645 +359678225963348 +447579217132384 +337227837807736 +50064495804948 +346738572598688 +236973679957932 +43507024710250 +182054289915448 +144962295951723 +306576462663442 +158787725603721 +495369066056668 +447459395413273 +344057922446779 +395633153332042 +504718322801880 +235325433870928 +437195528511478 +244135922948465 +479388167560850 +178697225954098 +354741533520645 +266092889230046 +204778327811708 +133257651959153 +559858783952067 +561750347064356 +502088076822870 +57253215150981 +380137870011881 +477972427100420 +240572372889603 +176519348368910 +337265364653435 +425502606217221 +88576070604575 +317517207500234 +334105164420725 +419958207401485 +226900054801398 +276961545643777 +370262654409489 +398886404251719 +296429275430113 +195072882755515 +396911272168989 +442208814882751 +113545916394642 +489754561221551 +233920144851839 +173259249369816 +500231355309754 +498284415309088 +125185151329730 +186407854088461 +435099856585532 +312951870547422 +173641362386746 +360822501532038 +74035636115208 +504940391363034 +276398928003630 +81858899939103 +498355101838391 +375087870889487 +228666656803973 +117849645842035 +82230055753383 +335785444943772 +548302224679651 +185276923758010 +164883456297448 +22085894978041 +332890468372985 +235730411838964 +132694589236093 +465257687386031 +45463633229820 +512144440666001 +480435371181081 +142485026456679 +462878761958728 +311750601954392 +553648287051728 +531478033022331 +460796621783993 +142368477545699 +74076278950557 +140439968185513 +236396470256590 +91860232604208 +223643558098429 +186390913765094 +364894662860662 +447459334215839 +537531128123739 +466218978171566 +126669151202583 +444807397890455 +349062089817739 +267434577690225 +560827859984118 +543253291644329 +514749596671611 +214538957126727 +123785267864708 +72460640000387 +113447716967257 +268936473540085 +276821706576117 +544257143536500 +82528952979392 +63833623452162 +327942426374098 +327087219832414 +198165652850622 +479015009633885 +64895098316007 +109357893943813 +426409434523539 +112785097737550 +416983983303055 +142741383992303 +538988077235072 +16786678261214 +21164214411945 +134856300517455 +305078463170046 +303351929503674 +247465549128864 +263204170523635 +364953615267699 +521418348349631 +63548040800203 +467923158941396 +92690222721000 +254607307817705 +315864590216006 +560194766273868 +57740965943123 +467500963508666 +64837056509709 +388201743880703 +449442624540704 +514951833787168 +108013527943658 +35164526162999 +245368857412234 +138434397003144 +36568275186461 +428992681216520 +88481766597912 +245305461122876 +194265537540846 +168923914421957 +386962933269608 +137066559578368 +458270149682274 +488069857309447 +234384742346167 +62174068894886 +557903634980987 +207715338997417 +480598384362874 +154285980882286 +154109362470773 +426356812378993 +137103739914800 +530043648763879 +237548210272004 +407973990813914 +325660721822690 +366188709699096 +66357483907787 +508053585941702 +497609763483254 +159345788693352 +266504908036111 +294179053237191 +79762673063029 +368453507033728 +88044353937870 +438409019445213 +293640084947314 +124562453993162 +270733529213570 +225383748762657 +22656925974863 +45753428221904 +12308965830816 +264478729958918 +187327926216617 +156237597038581 +512313969753142 +376857045442655 +547345752323760 +309009326256121 +322372699828345 +333725943467458 +471851170183208 +54397268148001 +35195325793204 +42277663445555 +183516135243541 +275376456197836 +369039746819263 +78769262868325 +372527716775987 +18484140147936 +85327286707391 +284283673228431 +355111648629777 +133597382682728 +475835693490394 +387127844576620 +507901751969565 +554351666415617 +289354297422412 +558003852365488 +99777852969028 +76910619800607 +269850823651503 +478945097944206 +75697824382299 +360460512821572 +293259869435075 +335549913652882 +497894910138558 +526824704037943 +58747445640376 +150428040936251 +334729039550240 +290593453052687 +308985893570621 +203875153466187 +422651545426053 +384663799808318 +361991609992814 +377373804266245 +455827670362139 +104590623650983 +57717523945642 +289215949135955 +279227190564306 +480037691230924 +379352975398179 +286239461806878 +6288706511920 +306203959502495 +132448912858619 +87444167270659 +195068918309615 +4583897617995 +278660466522789 +229077410961495 +252512285630884 +165702653225540 +57301645713338 +45476816770253 +104420509876312 +435928956867717 +273738252326421 +527592700256469 +274920860531438 +360461851428776 +457549708994889 +291781669625491 +74180496831125 +160275843387166 +193576416576971 +447891132305591 +136097875796043 +473879264008074 +342198614509293 +255620089584600 +253368119366628 +460058494829337 +238677179316060 +543435794096850 +125804528329371 +290067397130136 +232119285671042 +35694654573054 +42641552702267 +278776839076591 +103699070401591 +279365288063702 +417643384147076 +379617509547 +379645369232055 +311322634544213 +355309621133856 +429812843801729 +530934225704976 +330069171861872 +393722308841935 +68340441633804 +518143442338427 +232986159926944 +361743588078637 +217329960800401 +405088222683749 +343569438466783 +129128398485888 +253088938306002 +15716384141993 +237474176118378 +178860999465503 +75048075834107 +347432831372643 +374490515012787 +165463789709837 +43210266758020 +240320757904606 +546043742308925 +268675982457278 +177771306654206 +145786507718584 +11076363163905 +484909609574872 +128816963311079 +523319854124247 +26117232648704 +137050674692694 +23079577770737 +443411377285142 +65315168934772 +499140575667238 +527800907809878 +52685290797686 +145080076415183 +527652341580953 +238859707235644 +78797347429720 +356975639606757 +94196665557651 +435856797725816 +401856923204375 +4848439154911 +396231979271263 +446175960814349 +155684562354319 +175037918819066 +325333380510412 +368728830828405 +270416737462765 +169564774661274 +460530813706825 +540961108919221 +113046162484226 +96073579932556 +103978930453644 +509735553698137 +106330238456740 +145231786002646 +488984892594469 +44508439338201 +227325068421387 +237889201401574 +44486142440592 +424902175633277 +518747415560671 +33943878442428 +192946509962666 +509687942128140 +355986284736312 +387842938635694 +268219264421529 diff --git a/src/2025/day-05/python/xoyz69/main.py b/src/2025/day-05/python/xoyz69/main.py new file mode 100644 index 0000000..21f8d2e --- /dev/null +++ b/src/2025/day-05/python/xoyz69/main.py @@ -0,0 +1,37 @@ +import time + + +def part01(): + print("Advent of Code 2025 - Day 05 Part 01") + + with open("input", "r") as file_input: + combined_input = file_input.read() + fresh_ranges, ingridients = [ + x.strip().split("\n") for x in combined_input.split("\n\n") + ] + + pre_fresh_list = [nr for nr in [x.split("-") for x in fresh_ranges]] + + fresh_list = [] + + for ran in pre_fresh_list: + fresh_list.append([int(ran[0]), int(ran[1])]) + + yes_fresh = 0 + + for i in ingridients: + i = int(i) + + for j in fresh_list: + if i >= j[0] and i <= j[1]: + yes_fresh += 1 + break + + print(f"Result: {yes_fresh}") + + +if __name__ == "__main__": + print("-------------") + start_part1 = time.time() + part01() + print(f" -> Needed: {time.time() - start_part1}s") diff --git a/src/2025/day-05/python/xoyz69/pyproject.toml b/src/2025/day-05/python/xoyz69/pyproject.toml new file mode 100644 index 0000000..f280015 --- /dev/null +++ b/src/2025/day-05/python/xoyz69/pyproject.toml @@ -0,0 +1,9 @@ +[project] +name = "xoyz69" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.13" +dependencies = [ + "psutil>=7.1.3", +] diff --git a/src/2025/day-05/python/xoyz69/uv.lock b/src/2025/day-05/python/xoyz69/uv.lock new file mode 100644 index 0000000..43af596 --- /dev/null +++ b/src/2025/day-05/python/xoyz69/uv.lock @@ -0,0 +1,40 @@ +version = 1 +revision = 3 +requires-python = ">=3.13" + +[[package]] +name = "psutil" +version = "7.1.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e1/88/bdd0a41e5857d5d703287598cbf08dad90aed56774ea52ae071bae9071b6/psutil-7.1.3.tar.gz", hash = "sha256:6c86281738d77335af7aec228328e944b30930899ea760ecf33a4dba66be5e74", size = 489059, upload-time = "2025-11-02T12:25:54.619Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/93/0c49e776b8734fef56ec9c5c57f923922f2cf0497d62e0f419465f28f3d0/psutil-7.1.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0005da714eee687b4b8decd3d6cc7c6db36215c9e74e5ad2264b90c3df7d92dc", size = 239751, upload-time = "2025-11-02T12:25:58.161Z" }, + { url = "https://files.pythonhosted.org/packages/6f/8d/b31e39c769e70780f007969815195a55c81a63efebdd4dbe9e7a113adb2f/psutil-7.1.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:19644c85dcb987e35eeeaefdc3915d059dac7bd1167cdcdbf27e0ce2df0c08c0", size = 240368, upload-time = "2025-11-02T12:26:00.491Z" }, + { url = "https://files.pythonhosted.org/packages/62/61/23fd4acc3c9eebbf6b6c78bcd89e5d020cfde4acf0a9233e9d4e3fa698b4/psutil-7.1.3-cp313-cp313t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:95ef04cf2e5ba0ab9eaafc4a11eaae91b44f4ef5541acd2ee91d9108d00d59a7", size = 287134, upload-time = "2025-11-02T12:26:02.613Z" }, + { url = "https://files.pythonhosted.org/packages/30/1c/f921a009ea9ceb51aa355cb0cc118f68d354db36eae18174bab63affb3e6/psutil-7.1.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1068c303be3a72f8e18e412c5b2a8f6d31750fb152f9cb106b54090296c9d251", size = 289904, upload-time = "2025-11-02T12:26:05.207Z" }, + { url = "https://files.pythonhosted.org/packages/a6/82/62d68066e13e46a5116df187d319d1724b3f437ddd0f958756fc052677f4/psutil-7.1.3-cp313-cp313t-win_amd64.whl", hash = "sha256:18349c5c24b06ac5612c0428ec2a0331c26443d259e2a0144a9b24b4395b58fa", size = 249642, upload-time = "2025-11-02T12:26:07.447Z" }, + { url = "https://files.pythonhosted.org/packages/df/ad/c1cd5fe965c14a0392112f68362cfceb5230819dbb5b1888950d18a11d9f/psutil-7.1.3-cp313-cp313t-win_arm64.whl", hash = "sha256:c525ffa774fe4496282fb0b1187725793de3e7c6b29e41562733cae9ada151ee", size = 245518, upload-time = "2025-11-02T12:26:09.719Z" }, + { url = "https://files.pythonhosted.org/packages/2e/bb/6670bded3e3236eb4287c7bcdc167e9fae6e1e9286e437f7111caed2f909/psutil-7.1.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b403da1df4d6d43973dc004d19cee3b848e998ae3154cc8097d139b77156c353", size = 239843, upload-time = "2025-11-02T12:26:11.968Z" }, + { url = "https://files.pythonhosted.org/packages/b8/66/853d50e75a38c9a7370ddbeefabdd3d3116b9c31ef94dc92c6729bc36bec/psutil-7.1.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ad81425efc5e75da3f39b3e636293360ad8d0b49bed7df824c79764fb4ba9b8b", size = 240369, upload-time = "2025-11-02T12:26:14.358Z" }, + { url = "https://files.pythonhosted.org/packages/41/bd/313aba97cb5bfb26916dc29cf0646cbe4dd6a89ca69e8c6edce654876d39/psutil-7.1.3-cp314-cp314t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f33a3702e167783a9213db10ad29650ebf383946e91bc77f28a5eb083496bc9", size = 288210, upload-time = "2025-11-02T12:26:16.699Z" }, + { url = "https://files.pythonhosted.org/packages/c2/fa/76e3c06e760927a0cfb5705eb38164254de34e9bd86db656d4dbaa228b04/psutil-7.1.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fac9cd332c67f4422504297889da5ab7e05fd11e3c4392140f7370f4208ded1f", size = 291182, upload-time = "2025-11-02T12:26:18.848Z" }, + { url = "https://files.pythonhosted.org/packages/0f/1d/5774a91607035ee5078b8fd747686ebec28a962f178712de100d00b78a32/psutil-7.1.3-cp314-cp314t-win_amd64.whl", hash = "sha256:3792983e23b69843aea49c8f5b8f115572c5ab64c153bada5270086a2123c7e7", size = 250466, upload-time = "2025-11-02T12:26:21.183Z" }, + { url = "https://files.pythonhosted.org/packages/00/ca/e426584bacb43a5cb1ac91fae1937f478cd8fbe5e4ff96574e698a2c77cd/psutil-7.1.3-cp314-cp314t-win_arm64.whl", hash = "sha256:31d77fcedb7529f27bb3a0472bea9334349f9a04160e8e6e5020f22c59893264", size = 245756, upload-time = "2025-11-02T12:26:23.148Z" }, + { url = "https://files.pythonhosted.org/packages/ef/94/46b9154a800253e7ecff5aaacdf8ebf43db99de4a2dfa18575b02548654e/psutil-7.1.3-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:2bdbcd0e58ca14996a42adf3621a6244f1bb2e2e528886959c72cf1e326677ab", size = 238359, upload-time = "2025-11-02T12:26:25.284Z" }, + { url = "https://files.pythonhosted.org/packages/68/3a/9f93cff5c025029a36d9a92fef47220ab4692ee7f2be0fba9f92813d0cb8/psutil-7.1.3-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:bc31fa00f1fbc3c3802141eede66f3a2d51d89716a194bf2cd6fc68310a19880", size = 239171, upload-time = "2025-11-02T12:26:27.23Z" }, + { url = "https://files.pythonhosted.org/packages/ce/b1/5f49af514f76431ba4eea935b8ad3725cdeb397e9245ab919dbc1d1dc20f/psutil-7.1.3-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3bb428f9f05c1225a558f53e30ccbad9930b11c3fc206836242de1091d3e7dd3", size = 263261, upload-time = "2025-11-02T12:26:29.48Z" }, + { url = "https://files.pythonhosted.org/packages/e0/95/992c8816a74016eb095e73585d747e0a8ea21a061ed3689474fabb29a395/psutil-7.1.3-cp36-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:56d974e02ca2c8eb4812c3f76c30e28836fffc311d55d979f1465c1feeb2b68b", size = 264635, upload-time = "2025-11-02T12:26:31.74Z" }, + { url = "https://files.pythonhosted.org/packages/55/4c/c3ed1a622b6ae2fd3c945a366e64eb35247a31e4db16cf5095e269e8eb3c/psutil-7.1.3-cp37-abi3-win_amd64.whl", hash = "sha256:f39c2c19fe824b47484b96f9692932248a54c43799a84282cfe58d05a6449efd", size = 247633, upload-time = "2025-11-02T12:26:33.887Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ad/33b2ccec09bf96c2b2ef3f9a6f66baac8253d7565d8839e024a6b905d45d/psutil-7.1.3-cp37-abi3-win_arm64.whl", hash = "sha256:bd0d69cee829226a761e92f28140bec9a5ee9d5b4fb4b0cc589068dbfff559b1", size = 244608, upload-time = "2025-11-02T12:26:36.136Z" }, +] + +[[package]] +name = "xoyz69" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "psutil" }, +] + +[package.metadata] +requires-dist = [{ name = "psutil", specifier = ">=7.1.3" }] From 40bd3575a5b9acf41859378f3181bd9ef3a5e835 Mon Sep 17 00:00:00 2001 From: xoyz Date: Sat, 6 Dec 2025 04:02:17 +0100 Subject: [PATCH 2/2] feat: Day 05 Part 2 --- src/2025/day-05/python/xoyz69/main.py | 88 +++++++++++++++++++- src/2025/day-05/python/xoyz69/pyproject.toml | 1 + src/2025/day-05/python/xoyz69/uv.lock | 27 +++++- 3 files changed, 114 insertions(+), 2 deletions(-) diff --git a/src/2025/day-05/python/xoyz69/main.py b/src/2025/day-05/python/xoyz69/main.py index 21f8d2e..45ec6ac 100644 --- a/src/2025/day-05/python/xoyz69/main.py +++ b/src/2025/day-05/python/xoyz69/main.py @@ -1,5 +1,7 @@ import time +from tqdm import tqdm + def part01(): print("Advent of Code 2025 - Day 05 Part 01") @@ -30,8 +32,92 @@ def part01(): print(f"Result: {yes_fresh}") +def part02(): + print("Advent of Code 2025 - Day 05 Part 02") + + with open("input", "r") as file_input: + combined_input = file_input.read() + fresh_ranges, ingridients = [ + x.strip().split("\n") for x in combined_input.split("\n\n") + ] + + pre_fresh_list = [[int(n) for n in x.split("-")] for x in fresh_ranges] + fresh: list[list[int]] = [] + + range_start = [] + range_end = [] + + def if_in_get_index(x): + for i in range(len(fresh)): + compare = x >= fresh[i][0] and x <= fresh[i][1] + if compare: + return i + return None + + def if_ou_get_index(x, y): + for i in range(len(fresh)): + compare = (x <= fresh[i][0] and y >= fresh[i][0]) and ( + x <= fresh[i][1] and y >= fresh[i][1] + ) + if compare: + return i + return None + + for ran in range(len(pre_fresh_list)): + a, b = pre_fresh_list[ran] + + x, y = if_in_get_index(a), if_in_get_index(b) + + if x is not None and y is not None: + if x > y: + first = fresh.pop(x) + second = fresh.pop(y) + elif x < y: + second = fresh.pop(y) + first = fresh.pop(x) + else: + first = fresh.pop(x) + second = first + + a = first[0] + b = second[1] + elif x is not None: + first = fresh.pop(x) + a = first[0] + elif y is not None: + second = fresh.pop(y) + b = second[1] + else: + z = if_ou_get_index(a, b) + + if z is not None: + cache = fresh.pop(z) + + fresh.append([a, b]) + + range_start.append(a) + range_end.append(b) + + yes_fresh = 0 + + for ran in fresh: + cache = (ran[1] + 1) - ran[0] + yes_fresh += cache + + if False: # debug + print( + f"\tAdding: {f'{cache:,}'.rjust(19)} | {f'{ran[0]:,}'.rjust(19)} | {f'{ran[1]:,}'.rjust(19)}" + ) + + print(f"Result: {yes_fresh:,}") + + if __name__ == "__main__": print("-------------") start_part1 = time.time() part01() - print(f" -> Needed: {time.time() - start_part1}s") + print(f" -> Needed: {round((time.time() - start_part1) * 1_000_000):,}ns") + print("-------------") + start_part2 = time.time() + part02() + print(f" -> Needed: {round((time.time() - start_part2) * 1_000_000):,}ns") diff --git a/src/2025/day-05/python/xoyz69/pyproject.toml b/src/2025/day-05/python/xoyz69/pyproject.toml index f280015..86b64e3 100644 --- a/src/2025/day-05/python/xoyz69/pyproject.toml +++ b/src/2025/day-05/python/xoyz69/pyproject.toml @@ -6,4 +6,5 @@ readme = "README.md" requires-python = ">=3.13" dependencies = [ "psutil>=7.1.3", + "tqdm>=4.67.1", ] diff --git a/src/2025/day-05/python/xoyz69/uv.lock b/src/2025/day-05/python/xoyz69/uv.lock index 43af596..95cd70a 100644 --- a/src/2025/day-05/python/xoyz69/uv.lock +++ b/src/2025/day-05/python/xoyz69/uv.lock @@ -2,6 +2,15 @@ version = 1 revision = 3 requires-python = ">=3.13" +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + [[package]] name = "psutil" version = "7.1.3" @@ -28,13 +37,29 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c9/ad/33b2ccec09bf96c2b2ef3f9a6f66baac8253d7565d8839e024a6b905d45d/psutil-7.1.3-cp37-abi3-win_arm64.whl", hash = "sha256:bd0d69cee829226a761e92f28140bec9a5ee9d5b4fb4b0cc589068dbfff559b1", size = 244608, upload-time = "2025-11-02T12:26:36.136Z" }, ] +[[package]] +name = "tqdm" +version = "4.67.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2", size = 169737, upload-time = "2024-11-24T20:12:22.481Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2", size = 78540, upload-time = "2024-11-24T20:12:19.698Z" }, +] + [[package]] name = "xoyz69" version = "0.1.0" source = { virtual = "." } dependencies = [ { name = "psutil" }, + { name = "tqdm" }, ] [package.metadata] -requires-dist = [{ name = "psutil", specifier = ">=7.1.3" }] +requires-dist = [ + { name = "psutil", specifier = ">=7.1.3" }, + { name = "tqdm", specifier = ">=4.67.1" }, +]