r/adventofcode • • 7h ago

Meme/Funny [2026 Day 5] I think we'd all be better off without a fancy microwave

Post image
186 Upvotes

I think Eric must have had a traumatic experience with a fancy microwave at some point in his life. Hopefully this will cheer him up!


r/adventofcode • • 6h ago

Visualization [2026 Day 5] [Python] Just got my Fancy Microwave! (Terminal Visualization)

Post image
64 Upvotes

Be honest, how many did a cheeky submit on the sum of all numbers less than 10000. Code lives here: https://github.com/salt-die/Advent-of-Code/tree/main/2026/aoc_visuals


r/adventofcode • • 1h ago

Meme/Funny [2026 Day 05 (Part 2)] I'm not ashamed, you're ashamed.

Post image
28 Upvotes

r/adventofcode • • 8h ago

Visualization [2026 Day 5 Part 2] Pushing Buttons Visualization

Post image
57 Upvotes

r/adventofcode • • 2h ago

Meme/Funny [2026 Day 5] I was very confused for like 40 seconds

Post image
18 Upvotes

r/adventofcode • • 2h ago

Tutorial Big O notation and you

16 Upvotes

There have been a lot of memes about time asymptotic analysis of... varying accuracy, so I thought I'd make a post actually explaining how it works.


First of all, asymptotic analysis technically describes functions, not algorithms. For example, the technical definition is that f(n) is O(g(n)) if there exists some pair of constants, c > 0 and n0 > 0 such that abs(f(n)) <= c * abs(g(n)) for all n >= n0. This matters because you can technically talk about the asymptotic complexity of something like sin(n), which is actually O(1), because you can just pick any c > 1. What we actually mean when talking about the asymptotic complexity of an algorithm is typically how much time it takes. If you find the evaluation time as a function of the input size, what complexity class is it in? And at least if you have a non-oscillating function, which is a safe assumption for run time, there's another, (IMO) simpler definition you can use. Does the infinite limit of f(n) / g(n) converge or not?

See, there are really 3 main behaviors that the limit can have (plus oscillation). If it diverges, it means that f(n) grows so rapidly that g(n) starts becoming irrelevant. If it converges to 0, it means that g(n) grows so rapidly that f(n) starts becoming irrelevant. And if it converges to something other than 0, it means that they grow at similar rates and it just becomes a ratio. (You may remember this from finding the asymptotes of rational functions) We can think of these sort of like >, =, and < on a number line. f(n) ∈ O(g(n) is like a <= sign, because it grows no more rapidly than g(n), then f(n) ∈ o(g(n)) is <, f(n) ∈ Ω(g(n)) is >=, f(n) ∈ ω(g(n)) is >, and f(n) ∈ Θ(g(n)) is =. And I mention these, because a lot of the time when you hear about the asymptotic complexity, we mean something closer to Θ(g(n)). For example, it's technically accurate to call merge sort O(n2), but it's more interesting to point out that it's also O(n log n), unlike insertion sort.

As a worked example, consider something like bubble sort. For sorting algorithms, we typically use the number of elements to be sorted as the input and the number of comparisons as a proxy for time. On the first pass, you make n-1 comparisons, on the second pass, you make n-2 comparisons, etc, for a total of n(n-1)/2 comparisons. There are technically infinitely many functions that this is big theta of, but we typically just use the simplest one - Θ(n2). For contrast, consider something like merge sort. Assume for simplicity that you have 2k elements. There are k = log_2(n) layers, and if there are j blocks, you make n/j - 1 comparisons in each for a total of n - j comparisons for the layer. Glossing over some of the logic, this results in n*log(n) - n + 1 comparisons for the entire list, which is Θ(n log n).

However, we can actually talk about other things with algorithms. For example, space complexity looks at how much memory it takes. Using merge sort as an example, you typically use auxiliary arrays to store half the blocks, which eventually requires n/2 ∈ Θ(n) elements for the top level, plus log n ∈ Θ(log n) recursive calls at once, for a total of Θ(n). (This analysis is different for parallel merge sort) Or you might talk about best case complexity instead of average/general case. For example, if the array is already sorted, insertion sort takes 1 comparison to check that each element is in place for a total of n ∈ Θ(n) comparisons, compared to the general case, where it's Θ(n2)

But this already gets into some of the nuances. For example, big O notation is not the same thing as how many loops. Take, for example, 2026 Day 4. My solution uses 3 layers of loop, not counting the one for each line of the input. I have one loop going from 1 to the length of the string for the length of the code, one going from 0 to the code length for each element of the code, and one going from the starting index to the end of the list. But think about how long those last two loops are. If there are n characters in the string and k in the code, that inner loop only checks n/k colors. Multiplying the loops together, you get n * k * (n/k) = n^2, which is actually quadratic.

Or we also have to talk about input size. And for an Advent of Code example, I'm going to use my Intcode solution to 2024 Day 13. I just used Cramer's rule to solve the systems of equations, but to get around Intcode not having a division operator, I used repeated subtraction. That sounds quick enough, but while it would have theoretically worked for Part 2, the numbers were just too big. It's like how people really don't understand just how much bigger a billion is than a million. So when we're really operating on numbers like that, like factoring something, we typically use the number of bits as the input size. For example, it's the difference between sqrt(n) divisions for factoring and sqrt(2)n. One's sublinear, the other's exponential.

And sometimes, input size can be kinda vibes-based. For example, 2026 Day 3. There were two main strategies I saw people using. In one, you considered each pair of trees, used them to generate the other two points on a square, and checks those for trees. That "feels" more quadratic, because you're essentially going "for each tree, for each other tree...". Meanwhile, I also saw people systematically generating all possible rotated squares. You start by considering the possible sizes of a grid-aligned square (linear in min(L, W)), you consider each starting point (LW, or quadratic if the grid's a square), and you consider each possible offset around the square (linear in the size), which adds up to something like Θ(LW*min(L,W)2) for a rectangle or Θ(N4) for a square. It's technically accurate to also call the tree-based algorithm Θ(L2W2) / Θ(N4) if you look at the size of the grid as the input size, but because you're focusing on all the trees, it feels a bit more meaningful to talk about it as quadratic in the number of trees, as opposed to, say, checking all quartets of trees to see if they form a square, which would be quartic in the number of trees.


r/adventofcode • • 5h ago

Visualization [2026 Day 05 Part2] button presses as a tree

Post image
28 Upvotes

r/adventofcode • • 7h ago

Meme/Funny Me seeing the suspiciously fancy-microwave-shaped gift under the tree

Post image
36 Upvotes

r/adventofcode • • 10h ago

Visualization [2026 Day 5] Fun Cooker 10K

Thumbnail youtu.be
39 Upvotes

Nim + raylib source


r/adventofcode • • 5h ago

Meme/Funny Santa gotta invest more (Day 5)

Post image
15 Upvotes

Part 1: O(n3) here i gooooo

Part 2: wut?!


r/adventofcode • • 5h ago

Visualization [2026 Day 5] Rhythmic Factory

Post image
12 Upvotes

r/adventofcode • • 1h ago

Upping the Ante Reminder 1: unofficial AoC Survey 2026 (closes ~Dec 12th!)

4 Upvotes

Hello there! Only about one week left to fill out the survey!! 🙀 Please fill it out if you have not already, and tell your friends and enemies to do so as well. It closes late Dec 12th or so.

Here is the link to use or share:

🔴🟢🌟🔵🌟🟣🟠🔴🌟🟢🔵🌟🔴🟣✨✨✨

🌟🌟 Unofficial AoC 2026 Survey: https://forms.gle/JbZKoBqzG248Z6RV6

🔴🟢🌟🔵🌟🟣🟠🔴🌟🟢🔵🌟🔴🟣✨✨✨

Sharing it on Discord, Slack, Matrix, Mastodon, IRC, mailing list, ... it all helps! We're only a wee bit behind 2025, the other 12-day event:

Survey response per (UTC) day in December - line graph

Big thanks of course to the ~900 folks that already filled it out!

At the risk of making the results statistically even more unsound, here's an early spoiler of one of the results in a revamped chart, take your guess at what we are seeing here in 2026!?

Bar chart without title or x-axis labels

I'm bringing my laptop to New Zealand especially to release the results briefly after the release of the final puzzle day! So one final call: do make it extra worthwhile by sharing the link to the survey!


r/adventofcode • • 21h ago

Meme/Funny Surely, I can't be the only one... right?

Post image
151 Upvotes

r/adventofcode • • 15h ago

Visualization [2026 Day 3] Accidental Christmas wreath

Post image
48 Upvotes

Coincidence... I think not.


r/adventofcode • • 29m ago

Meme/Funny [2026 Day 5] My nemesis

Post image
3 Upvotes

r/adventofcode • • 4h ago

Other [2026 Day 5 (Part 2)] Lucky us

5 Upvotes

After reading Part 1, I immediately thought, 'Watch out!' Eric must have chosen the opposite problem for Part 2, i.e. finding a sequence of key presses that results in a specific number. This works, too, but at least the effort I put into Part 1 paid off :-)


r/adventofcode • • 21h ago

Meme/Funny [2026 Day 4] When your pt 2 finally works... and runs faster than pt 1

Post image
122 Upvotes

r/adventofcode • • 5h ago

Other [2026 Day 5 (Part 1)] "at most three button presses"

6 Upvotes

At the end of the question body, it asks:

Considering just the buttons on the Elves' fancy microwave, what is the sum of every number reachable in at most three button presses?

Nonetheless, I get the same answer regardless of if I structure my code to handle exactly three or at most three button presses, for both my personal puzzle input and for the example puzzle input.

For the zero button push case, the resulting value is zero, so it won't affect the sum one way or another.

For the one button push cases, they can be converted to three button pushes without changing the value by appending [A] [bksp] to the method.

However, I don't see an easy way to convert the two button push cases to three button pushes without changing the value.

My questions are a) does everybody get the same answer regardless of if they handle exactly three or at most three button presses and b) will this naturally occur for all inputs with one of each of the available six types of buttons, or if the inputs were specifically constructed to have the same answer.


r/adventofcode • • 3h ago

Help/Question - RESOLVED 2026 Day 5 (Part 1) Examples or edge cases?

4 Upvotes

Writing in Python, but I am trying to not look at solutions and don't wish to share my code for the same reason.

I have the classic, "code works on example, too low for real input" and I just wonder if some very clever people here have thought of special cases or examples for why things might go wrong?


r/adventofcode • • 6h ago

Other [2026 Day 5] Did anyone get a 2-digit button like in the example?

7 Upvotes

The example for the multiplication button is *11 but in my input I found only digits so I saved myself the trouble. But now I wonder... Did anyone actually get more than one digit on a button?


r/adventofcode • • 8h ago

Help/Question [2026 Day 5 (extra)]

9 Upvotes

What is the set of nine commands that would return the largest number for the second part of the puzzle?


r/adventofcode • • 11h ago

SOLUTION MEGATHREAD -❄️- 2026 Day 5 Solutions -❄️-

12 Upvotes

THE USUAL REMINDERS


AoC Community Fun 2026: The Advent Games

  • Submissions megathread is unlocked!
  • 12 DAYS remaining until the submissions deadline on December 17 at 18:00 EST!

Today's Event: Iron Chef Holiday Special

"Catherine, if this turkey tastes half as good as it looks, I think we're all in for a very big treat!"
— Clark Griswold, National Lampoon's Christmas Vacation (1989)

Today's schedule possibly consists of:

Appetizer and Aperitif Rounds

  • Use up what's in your fridge with all of those semi-sentient leftovers excavated from the back of the fridge
  • Deliberately use deprecated functionality
  • Program using old codebases
  • The older the expiration date finer the vintage, the more we'll enjoy it!

Main Course Qualifications

  • Solve today's puzzle using a food-themed programming language
  • Bake or cook us something delicious

Dessert Finales

  • Show us cookies, citrus, and/or fancy bread in/on/near your holiday tree/menorah/festive kitsch
  • Show us your 1337 hot cocoa recipe (or other beverage of choice)

This prompt is totally not bait for our resident Iron Coders and/or some AoC regulars who promised us tasty pictures

Request from the mods: When you include an entry alongside your solution, please label it with [Advent Games] so we can find it easily!


--- Day 5: Rhythmic Factory ---


Post your code solution in this megathread.


r/adventofcode • • 18h ago

Other Tried AOC for the first time this year, feeling demotivated to keep going.

40 Upvotes

I studied frontend development, did quite good and graduated amongst the top in my class in the summer of 2025. I worked 1 year at a large company here in Sweden and was complimented for how good they thought I was. I have always known about AOC but never tried it, I thought that now is the time and maybe I can have some fun. But I am not having fun...

I am struggling with even understanding the questions. Especially for day 2 and 4. When I eventually maybe understand the question, I have absolutely 0 clue on how to solve it. I could do Day 1 part 1 and 2, that wasn't really a problem but Day 2 both parts, Day 3 part 2, and Day 4 have collectively demotivated me and make me feel like this field is not something I can do.

I try to have LLM dumb down the question for me and after a while I can finally understand kind of what the goal is. But I still have 0 clue on how to go about it. I tell the LLM to explain to me but not write code, and it just never clicks for me. Today, Day 4 Part 1 is absolutely impossible for me to finish.

I was always incredibly bad at math and failed quite easy math courses even when trying hard, maybe that is related to the difficulty I have with this.

Is there some way to practice these types of things to get better? Maybe I can keep up better next year if I have a year to practice... Or maybe I am just not made out for this, I don't know what to think at this point.

Since I am a frontend developer, I am doing in JavaScript, if that matters, but I don't think it would.


r/adventofcode • • 14h ago

Upping the Ante [2026 Day 4] How many times can you repeat part 2?

Post image
16 Upvotes

I wanted to see if I could take the instructions that generated my part 2 and find shorter instructions that generated them.  Like consider ?vg?b?vb → bvg?b?v → bvg?b → bvg? → bvg which you can compress four times. I applied the code to my part2 input it turns out I can't: my part 2 solution is its own instructions. 

Which is maybe weird.  I've done simulations which show that 92% of random inputs like mine end up being able to recurse at least two times with some being able to go very deep.  An 8% chance is not tiny but still...

So I'm curious what other folk's depths are; did I get a low-probability input or is there perhaps something in the way the inputs are generated that leads to this?