𓁟 host1.bitchan.one

𓀐 @GgfKxzY3: >Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other. https://adventofcode.com/ /g/ leaderboard join code: 224303-2c132471 anonymous-only leaderboard: 383378-dd1e2041 22 hours and 37 minutes remain.

edition 1: >Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other. https://adventofcode.com/ /g/ leaderboard join code: 224303-2c132471 anonymous-only leaderboard: 383378-dd1e2041 lets hope eric does not phone it in this year

⧖expiring0/36 kept1d ago

𓀐 @8pqAgBxt

⏱ 2d 👍 0

⬆ upvote 0

[⇥] sort oldest ⏱
filter [-]
𓀐 @sWtuUikQ: >lets hope eric does not phone it in this year too late+

⬆ upvote 0↩ reply 0

𓀐 @ee7zpPdA: Digits and we actually get the full 12 puzzles this time.+ 1

⬆ upvote 0↩ reply 1

𓀐 @Ruu~V2rq: interesting use of chunk_by. I usually use https://docs.rs/itertools/0.15.0/itertools/trait.Itertools.html#method.coalesce for something similar, but chunk_by seems to work the way I'd expect for this problem so I can drop it. thanks for the idiomatic solution, bro.+ 1

⬆ upvote 0↩ reply 1

𓀐 @nWz-tr8h: oops, meant to quote OP+

⬆ upvote 0↩ reply 0

𓀐 @vXetGGYH: Obviously this problem is trivial to do in linear time but it might be interesting to do it in better than linear space. Maybe you'd have to use a frequency estimating algorithm to do it? That can get you part 1 at least, but part 2 might be weird unless you make assumptions about the input+

⬆ upvote 0↩ reply 0

𓀐 @8xL9-_CH: >import solution from collections import Counter from functools import reduce from operator import mul with open('p01.txt') as fh: nums = Counter(int(l) for l in fh.readlines()) mc = [n for n, _ in nums.most_common()] print(reduce(mul, mc[:3])) print(reduce(mul, mc[-3:])) why does he bother with these day 1 shits. if there's only 12 days fuckin lets go+ 1

⬆ upvote 0↩ reply 1

𓀐 @pabLfZtD: day 1 sloppa+ 2

⬆ upvote 0↩ reply 2

𓀐 @?+DW4UdX: Going from reviewing vibecoded pull requests all year at work to working on an AoC problem in a language I like because it's declarative and visually pleasing feels like the cheeseburger scene in The Menu.+ 1

⬆ upvote 0↩ reply 1

𓀐 @~T~tsm4x: bigboy #1 url: https://files.catbox.moe/mxtzl9.7z lines: 17044061 silver: 57068430797700 gold: 941654718771813+

⬆ upvote 0↩ reply 0

𓀐 @2ZnEbekU: beef wins again, too easy+

⬆ upvote 0↩ reply 0

𓀐 @oVVSRGtS: >Iterator::by_ref ? use slice::sort_by_key, Iterator::take, and Iterator::product+

⬆ upvote 0↩ reply 0

𓀐 @yae2e3Xm: >just parse invalid input bro >just ignore errors bro dumb retard+

⬆ upvote 0↩ reply 0

𓀐 @d64CPm?h: thread full of halfwits, lmao >sorting why are you sorting? stupid+

⬆ upvote 0↩ reply 0

𓀐 @t?*aS?iV: is aoc unironically dead? used to be way more posters and they used to have many threads leading up to the actual day doing previous years problems.+ 1

⬆ upvote 0↩ reply 1

𓀐 @+qYsWtYC: >the whole board and chan kind of is what triggered that?+

⬆ upvote 0↩ reply 0

𓀐 @siQKNB6i: do you know how to find the largest integer in an array, without sorting it? if the current largest item gets promoted, then what it was previously, would currently be the next largest and so on. very simple stuff, anon. just a linear scan and some checks, no quickselect pivot crap, no min heap sillyness.+

⬆ upvote 0↩ reply 0

𓀐 @QB5XDmJm: I wanna use different languages for each day this year as a break from c. Any sugestions?+

⬆ upvote 0↩ reply 0

𓀐 @x68vnNW2: I'd like to announce me being unfiltered by last year's day 10. Did it before christmas so it counts. https://files.catbox.moe/u996c1.png Looking back I really really should have used rational arithmetic. Maybe this year.+

⬆ upvote 0↩ reply 0

𓀐 @cUNrdL*p: I'm sick of all the idiomatic solutions. give me a IDIOTIC solution+

⬆ upvote 0↩ reply 0

𓀐 @7CCgFHcD: last year, even though we didn't have the global leaderboard, i could've sworn the "personal stats" page still showed your rank but it's not there anymore, just your "personal times". am i misremembering?+

⬆ upvote 0↩ reply 0

𓀐 @rPyJ?7CJ: A robot with program roygbv would travel a total distance of 11. No it fucking wouldn't. Let's frame it in the same way as the prior example. roygbvroygbvroygbvroygbvroygbvroygbvroygbvroygbv ^ initial robot position roygbvroygbvroygbvroygbvroygbvroygbvroygbvroygbv ^ robot travels distance 1 to next orange waypoint roygbvroygbvroygbvroygbvroygbvroygbvroygbvroygbv ^ robot travels distance 1 to next yellow waypoint roygbvroygbvroygbvroygbvroygbvroygbvroygbvroygbv ^ robot travels distance 1 to next green waypoint roygbvroygbvroygbvroygbvroygbvroygbvroygbvroygbv ^ robot travels distance 1 to next blue waypoint roygbvroygbvroygbvroygbvroygbvroygbvroygbvroygbv ^ robot travels distance 1 to next blue waypoint After these instructions, the robot has traveled a total distance of 5. THAT'S IT I wasted 15 minutes debugging part 1 before I realized the second fucking example is just wrong.+

⬆ upvote 0↩ reply 0

𓀐 @NrpKPfQn: bigboy #2 url: https://files.catbox.moe/mhw4zx.7z size: 142M silver: 558275033 gold: 893216516+

⬆ upvote 0↩ reply 0

𓀐 @WawQJ82K: sorry fellas, catbox shat the bed bigboy #2 url: https://gofile.io/d/b9mffmvi size: 142M silver: 558275033 gold: 893216516+

⬆ upvote 0↩ reply 0

𓀐 @-Q9b~nUV: All of your part 2s are wrong+

⬆ upvote 0↩ reply 0

𓀐 @k=S2p?8R: Yep, there is a typo. It should be p2 * 6 - 5.+

⬆ upvote 0↩ reply 0

𓀐 @zMqaqKkA: most solutions you guys come up with are ugly. the numerical solvers should piss off to /sci/+

⬆ upvote 0↩ reply 0

𓀐 @n7?RY3QA: >Most of my leaderboard rivals from last year are not participating this year (HiggstonRainbird, Oresama, mid-kid, sin-ack) >No twitch thot streaming "her" solutions >No ASM anon >No looking-for-internship >Only 2 threads in 2 days Very quiet this year.+

⬆ upvote 0↩ reply 0

𓀐 @2ZUuNgX3: am I the only one who bothered with the "no color in input" edge cases?+

⬆ upvote 0↩ reply 0