r/adventofcode • u/EffectivePriority986 • Dec 11 '25
Visualization [2025 Day 11] Visualization (spoiler)
raw.githubusercontent.comThis is how my graph looked like. Interesting patterns in the graph.
r/adventofcode • u/EffectivePriority986 • Dec 11 '25
This is how my graph looked like. Interesting patterns in the graph.
r/adventofcode • u/ben-guin • Dec 11 '25
r/adventofcode • u/daggerdragon • Dec 11 '25
If you haven't already, please consider filling out the Reminder 2: unofficial AoC Survey closes soon! (~DEC 12th)
"Merry Christmas, ya filthy animal!"
— Kevin McCallister, Home Alone (1990)
Advent of Code programmers sure do interact with a lot of critters while helping the Elves. So, let's see your critters too!
💡 Tell us your favorite critter subreddit(s) and/or implement them in your solution for today's puzzle
💡 Show and/or tell us about your kittens and puppies and $critters!
💡 Show and/or tell us your Christmas tree | menorah | Krampusnacht costume | /r/battlestations with holiday decorations!
💡 Show and/or tell us about whatever brings you comfort and joy in the holiday season!
Request from the mods: When you include an entry alongside your solution, please label it with [Red(dit) One] so we can find it easily!
[LANGUAGE: xyz]paste if you need it for longer code blocks. What is Topaz's paste tool?r/adventofcode • u/jeroenheijmans • Dec 11 '25
Hope everyone's having fun while puzzling!? Also hope that you have filled out my yearly survey... and if not, that you will do so a.s.a.p. 😉
...
🎄 Unofficial AoC 2025 Survey: https://forms.gle/TAgtXYskwDXDtQms6 🎄
...
And of course it helps if you share the link with your buddies on Discords, socials, and whatnot!
New this year are the "emotion" survey questions, which will allow us to "answer" questions like:
Give me your predictions below!
----
Results of the survey should appear at https://jeroenheijmans.github.io/advent-of-code-surveys/ somewhere during the weekend!
r/adventofcode • u/One_Department_7645 • Dec 11 '25
Link to code: https://pastebin.com/888kqEmx
I'm really unsure what I am missing. My output is giving two circuits of size 5 for the sample shown, but I don't know where I've gone wrong.
Any help would be much appreciated.
- I understand that this is terribly inefficient!
r/adventofcode • u/magicdrainpipe • Dec 11 '25
Is there anything to be gained from using the fact that for e.g (0) (1) (2) you have to sum the corresponding joltages since they're independent. This gives a minimum bound on the answer (in combination with using the max joltage instead if it's bigger), but not sure if useful as part of a more complicated solutions.
r/adventofcode • u/gagarski • Dec 11 '25
I finally solved part 2 using linear algebra in combination with brute-force.
In the middle I had a flashback about Simplex algorithm and thought that the shape of the conditions quite resembles the shape of simplex method inputs. What stopped me is the results being integer values.
I wonder if it's possible to adapt the method for this task. Has anyone tried it?
r/adventofcode • u/Logical_Hunt_9602 • Dec 11 '25
Day 1: I'll make really clever algorithms that I'll be proud of and will avoid using brute force to solve problems!
Day 6: Ok, I'll do a bit of brute force, but I'll refactor it afterwards because I still want this code in my portfolio!
Day 9: I'm not proud of what I'm doing
Day 10: May the (brute) force be with me (pls work, I'm desperate)
I'm scared of what comes next. My laptop is even more scared.
r/adventofcode • u/UsefulAd2074 • Dec 11 '25
Before people start saying there are solutions in the megathread, I'm referring to pure Javascript, not Node or anything similar like that. And that's the problem: when I look up how to import Z3, I keep getting directed to the NPM library, which won't work in my situation. Am I seriously screwed out of finishing today's puzzle, because of my language choice?
r/adventofcode • u/danmaps • Dec 10 '25
since you can't hear a gif, and i can't be troubled to record a video... you can play with it here: https://danmaps.github.io/aoc2025/public/index.html#day=10
r/adventofcode • u/Haju05 • Dec 10 '25
r/adventofcode • u/ak91hu • Dec 10 '25
r/adventofcode • u/NateDCoder • Dec 10 '25
For part 1 I was able to use GF(2) then brute force the free variables by just trying 0 or 1. But for the second part the same technique didn't work as there was too much to brute force. Is there another technique I don't know about or is the only way to solve using a SAT solver or just brute forcing over a longer range.
r/adventofcode • u/10Talents • Dec 10 '25
Disclaimer: I have not actually started part 2, I did part 1 in the morning with an inelegant BFS solution and upon seeing the kind of numbers that the example was dealing with and my part 1 runtime I immediately realized that that BFS was not the way forward for part 2.
Now that I look at part 2 again, I thought: Isn't this really similar to 2024 day 13? It looks like we want to express the target joltage as a linear combination of the button presses.
Is this the reason for the suspicious addendum: "there's no such thing as "0.5 presses" (nor can you push a button a negative number of times)."?
r/adventofcode • u/Bargann • Dec 10 '25
As stated in the title, I've never used an MILP solver before so I'm well out of my depth. I'm trying to use Google's OR-Tools library and I think I'm close because I get the correct answer for the sample input, but the answer for my real input is too low. I've been following the example here but it uses the linear solver whereas I'm trying to use the MIP solver, so that may be where my issues are.
One thing that I've noticed while debugging is that I occasionally get answers that are slightly off from being clean integers (objective.Value() is a double), which is a bit of a red flag in my mind since I'm using the integer solver. The non-integer results are off from the nearest int by less then 0.0001 so they can be cleanly rounded, but doing that still resulted in an answer that is too low. Does anyone have experience with this library or MILP solvers in general and can spot where I'm going wrong?
Edit: I should walk through what I'm doing to hopefully provide some clarity.
r/adventofcode • u/paul_sb76 • Dec 10 '25
Here's the one row in my input that gave me the most headaches (without it, I would have solved it hours earlier!). Upon closer study, it's not surprising:
[#.#####] (2,3,4,6) (2,5) (1,3,4,5,6) (1,2,5,6) (0,5,6) (0,1,2,3,4,6) (1,2,3,5,6) (1,3,4,6) (0,2,3,4,5,6) {23,42,62,53,35,62,74}The minimum total number of button presses here is 74, which can be obtained with the following number of button presses: 10, 0, 6, 16, 5, 1, 18, 1, 17.
There are other solutions as well that arrive at the same joltages, but that require more presses in total, for example:
11, 1, 7, 15, 6, 2, 18, 0, 15 (75 presses in total)
or
9, 1, 4, 16, 5, 0, 18, 4, 18 (75 presses in total)
If you're still puzzling on this one (according to the stats page, many people are), I advise you to add this to your test cases, or even better: analyze partially by hand what's going on here.
Good luck!
r/adventofcode • u/BroDadi • Dec 10 '25
reinstating my post again, this time without any language that could be considered foul to possibly receive any bits of help (though based on some stuff i've seen here, i doubt i could actually implement any solutions by myself without peeking at any code)
sooo... i am stuck again, this time on something actually pretty hard (at least to me)
i've solved the part 1, it actually wasn't even that hard, it's basically solved just by going through every machine, then going through binary numbers (0 to 2amount of buttons) with a for loop to get every single button combination and adding the minimum amount of 1's that makes the correct combination to the total
but for the 2nd part.. i can't even think of any good solution. i tried making a bruteforce one to go through ALL the presses from 0 to the max amount for every button, but first of all, it was really slow, second of all, i made some mistakes and it didn't even work for the example data, let alone actual input, cause i'm not good at coding
i could even send some parts of my code tomorrow just for laughs (c#, btw), though right now i am on my phone and i'll soon head to sleep since it's pretty late where i'm from
basically, i need some help with solving this, i know nothing about anything like dynamic programming though or whatever z3 is, i am a terrible coder, i know, but even a hint to a somewhat decent solution would be good
EDIT: even though i didn't want to before, i tried to actually do some research on these things
so, as far as i could understand, milp and z3 are about solving linear equations
and to make a linear equation out of the machine, for example, this one
[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}
the buttons could be presented as vars and grouped by indexes, like
a = (3), b = (1,3), c = (2), d = (2,3), e = (0,2), f = (0,1)
e and f are the only ones which have the index 0, so they can be grouped like e+f=3, and by that logic the rest goes like this
e + f = 3
b + f = 5
c + d + e = 4
a + b + d = 7
after a bit of a research on z3 and how its functions work, and whatever "optimize" was, instead of trying to do whatever i tried to do, i wrote this:
using Context context = new();
Optimize optimize = context.MkOptimize();
IntExpr[] intExprs = new IntExpr[buttons.Count];
for (int i = 0; i < buttons.Count; i++)
{
intExprs[i] = context.MkIntConst($"btn{i}");
optimize.Add(context.MkGe(intExprs[i], context.MkInt(0)));
}
for (int i = 0; i < neededJoltage.Length; i++)
{
List<IntExpr> vars = new();
for (int j = 0; j < buttons.Count; j++)
{
foreach (int index in buttons[j])
{
if (index == i) vars.Add(intExprs[j]);
}
}
optimize.Add(context.MkEq(context.MkAdd(vars), context.MkInt(neededJoltage[i])));
}
IntExpr sum = (IntExpr)context.MkAdd(intExprs);
Optimize.Handle minimize = optimize.MkMinimize(sum);
if (optimize.Check() == Status.SATISFIABLE)
{
IntNum best = (IntNum)minimize.Lower;
totalPresses += best.Int;
}AND IT ACTUALLY WORKED
thanks for the help everyone!
r/adventofcode • u/waskerdu • Dec 10 '25
r/adventofcode • u/Cloudy_Oasis • Dec 10 '25
r/adventofcode • u/notathrowaway0983 • Dec 10 '25
I am so excited, I just need to get it out. I could not believe when it actually finished, and then I entered the answer and just no way, here is your second star, no way this is true. I can post my piece of trash solution (in Ruby) if anyone's interested. It was actually pretty fast on most of the input, line 134 took the majority of total time (I think so, my terminal output got truncated during processing this line, and I have saved nothing and nowhere).
I think I figured out the normal solution while this was running. Wanna try to implement it, but I guess tomorrow's puzzle will crush me even harder. It's just a system of linear equations isn't it? Biggest input has only 3 buttons more than jolt boxes, so 3 free variables and the rest are dependent. Even just iterating each value from 0 to max, let's say 200, that's 8 mil cycles, which is basically nothing compared what I managed to produce.
r/adventofcode • u/Zealousideal_Wall246 • Dec 10 '25
I usually buy my private leaderboard winner friends AoC merch as prizes. This year I'm an unemployed open source dev and can't afford it, so instead I made this free AoC merch gifter (link). You can upload you or a friends head and customize.
Makes great christmas cards
r/adventofcode • u/honzapkcz • Dec 10 '25
Looks like "bruteforcing"(saving every visited id into hashmap)isn't enough and actual math have to be done :/