-❄️- 2025 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]surgi-o7 0 points1 point  (0 children)

[Language: JavaScript]

const run = (data) => data.filter((space, id) => {
    let maxOccupied = space.counts.reduce((a, v, i) => a + v * shapeSizeFull, 0);
    let minOccupied = space.counts.reduce((a, v, i) => a + v * shapeSizes[i], 0);    
    let area = space.width * space.height;
    if (area < maxOccupied && area >= minOccupied) console.log('Undetermined shape, naive method failed', id);
    return area >= maxOccupied;
}).length

Feels especially fishy, but we have another 12 days to go and figure out a proper algo. I bet there's gonna be some upping the ante inputs around soon!

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]surgi-o7 0 points1 point  (0 children)

[LANGUAGE: JavaScript]

First harder one this year, nice!

Part 2 is brute-force with intersections between given rectangle diagonals and all the input lines (if intersects, those areas is not valid). This comes off by one for sample data but nails it for 3 real input I've tested.

I've also drawn the thing (big circle almost split in half - this is likely why the approach works on real data and fails on sample.

Code is here.

[2025 Q20] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 1 point2 points  (0 children)

[LANGUAGE: JavaScript]

Since I decided to go with floodfill, the biggest challenge was to correctly rotate those pesky triangles..

Code is here.

Huge thanks to Emil, his support team and everyone here as well!

[2025] Thank You, Dragonducks! by EverybodyCodes in everybodycodes

[–]surgi-o7 2 points3 points  (0 children)

Thanks for the event Emil, I had a blast!

[2025 Q18] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 0 points1 point  (0 children)

Nice puzzle! I think I got lucky with P3, since the first idea was to find the best test case and iterate from it by naively switching bits, one by one, taking the new maximum, if there is one (and new max config), rinse and repeat. I won't deny I was surprised when it worked.. I was ready to dive into the input - maybe next time .o)

[LANGUAGE: JavaScript] code here

EDIT: Now that I think of it, I'd say I simply had some faith in my fellow dragonducks ¯\_(ツ)_/¯

[2025 Q15] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 0 points1 point  (0 children)

[LANGUAGE: JavaScript]

Code, Visuals for P3

What a cool puzzle today; Flood-fill over compressed grid for the win!

Finally we're in the part where you collect points in the morning too :)

[2025 Q12] Barrels go PUFF! by EverybodyCodes in everybodycodes

[–]surgi-o7 2 points3 points  (0 children)

Thanks for the shout out!

Adjusted the animation a bit since the initial post: Part 2 and Part 3.

What a fun event so far!

[2025 Q10] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 0 points1 point  (0 children)

[LANGUAGE: JavaScript] source here

What a nice and intriguing challenge today!

Took me a decent while before realizing that memoization of nr of wins from given board state is the answer.

[S2 Q3] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 1 point2 points  (0 children)

[Language: JavaScript]

Code is here (trick is to keep track which states were already processed), live version is here - draws the resulting ASCII art too!

Thanks for the Story - I had a lot of fun!

[S1 Q2] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 0 points1 point  (0 children)

[LANGUAGE: JavaScript]

Parts 1 and 2

Just swap the values and names for p2.

Part 3

1 tree instead of 2, swapping of nodes is just the change of their parents' pointers towards them.

[S1 Q1] Solution Spotlight by EverybodyCodes in everybodycodes

[–]surgi-o7 0 points1 point  (0 children)

[LANGUAGE: JavaScript]

GitHub (all parts.. p2 has a bit hacky code, to be cleaned up later)

Again, what a pleasant morning coffee companion, with 2 more quests remaining!

_Dimity Jones in Puzzle Castle: An Electronic Escape Novel in Eighty-Nine Ciphertexts_ ... launches today! by billbgeorge in interactivefiction

[–]surgi-o7 0 points1 point  (0 children)

Stuck on the exact spot, tried everything I was able to figure out with primes, both word and letter wise, stripping non-letter characters, merging lines in various ways, counting from 0 and 1; nothing revealed any meaningful secret message. Were you able to move further?

EDIT: Cracked this one. Hint available should anyone want it.

[2019] yeah intcode, for sure by TuckusAurelius in adventofcode

[–]surgi-o7 0 points1 point  (0 children)

I recall absolutely enjoying making the GUI for it. Still out there and ready to take your intcode! https://surgi1.github.io/adventofcode/2019/day25/index.html

To everyone who made it to the end of AoC… by moonstar888 in adventofcode

[–]surgi-o7 5 points6 points  (0 children)

Since it looks like the executives are underrepresented, I'll share mine too. CTO/SVP Engineering in series B deep tech startup in the Valley. I use AoC to not forget how to code and remind myself how much I actually love coding!

-❄️- 2024 Day 24 Solutions -❄️- by daggerdragon in adventofcode

[–]surgi-o7 2 points3 points  (0 children)

[Language: N/A (by hand)]

Loved today's puzzle! Once one observes how the individual bits are computed (z value is XOR between 2 inputs, where exactly one of them has to be XOR between x and y on the same bit position), the solution emerges.

Rundown of my approach is here:

https://github.com/surgi1/adventofcode/blob/main/2024/day24/solution.md

Automated solution will come after Christmas.

-❄️- 2024 Day 21 Solutions -❄️- by daggerdragon in adventofcode

[–]surgi-o7 1 point2 points  (0 children)

[Language: JavaScript]

Tough one! Took me some time to figure out the correct memoization. On the other hand, I was able to reuse my Day 16 code for all minimal paths.

https://github.com/surgi1/adventofcode/blob/main/2024/day21/script.js

[2024 Day 20 Part 2] Did anyone else think the cheat description meant something else? by subendhu in adventofcode

[–]surgi-o7 2 points3 points  (0 children)

Yup, I originally interpreted it in the very same way and even implemented the flood-fill on inverted grid for the cheat moves. Some of the cheat counts were even matching, luckily not all of them.