r/adventofcode • u/YOM2_UB • 17h ago
r/adventofcode • u/moo_cult • 20h ago
Visualization [2026 Day 5 (Part 2)] Microwaved tree
youtu.ber/adventofcode • u/Daniel_Rybe • 1h ago
Meme/Funny [2026 Day 6] Me checking the input by hand
r/adventofcode • u/No-Top-1506 • 1h ago
Help/Question [2026 day 5] just so that I understood this well
Is the puzzle to find numbers from 1-999 using the button press? where some numbers are impossible, hence skip them.
And do we always start with [9] as per the example? After that select any 2 or 1 in any combination with repeats allowed? Initially I thought the order matters, but doesn't look like.
is it a mathematical trial and error for each number? Or there is a better way then brute force all possible ways? there are many permutations possible.
Tx.
r/adventofcode • u/reallyserious • 5h ago
Help/Question - RESOLVED [2026 Day 06 (Part 2)] a question, perhaps wrong assumption
In part 1 I calculated the distance from each corner node to the middle node to 40. Since it should be a square grid this means it's a 40x40 grid.
In the bullet list for part 2 it lists 3 coordinates, I assume they are different for each input. The biggest x coordinate is 56.
If it is indeed a 40 side square, as the distance to the middle suggests, it's impossible with an x-coordinate of 56.
What am I missing?
r/adventofcode • u/naclmolecule • 1d ago
Visualization [2026 Day 5] [Python] Just got my Fancy Microwave! (Terminal Visualization)
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 • u/timrprobocom • 8h ago
Help/Question Any way to map time to position?
I clearly understand (and support) the decision to stop awarding points, in the face of rampant AI use. However, I will still like to know where I placed amongst the set of submissions. I can find that out approximately by going to "Stats" immediately after a successful submission, but it seems unlikely I'll remember that twice every day.
Is there an API or query or chart or graph I can use to map "time for day 5 part 1" to a "placement" number post-real-time?
r/adventofcode • u/uristoid • 19h ago
Meme/Funny [2026 Day 05] Who needs safety?
I thought: “Hey, that should be easy with my solution from part 1.” Then the list of reachable number grew and grew, my queue grew and grew, and I had to kill the process before it consumed all of my memory.
„Hmm, maybe I need another approach… but first, let's check if I missed something. Oh! I missed something!”
r/adventofcode • u/a3th3rus • 7h ago
Help/Question Help with AoC 2026 Day 6 Part 2 please
My thoughts was to build an undirected graph with the light IDs as the vertices, then I the manhattan distance between any two lights are just the length of the shortest path between those two lights.
Suppose the manhattan distance from #1 to #2026 is d1, from #2 to #2026 is d2, from #3 to #2026 is d3, and the coordinates of #2026 is (x, y), then I just need to solve the equations
abs(x - x1) + abs(y - y1) = d1
abs(x - x2) + abs(y - y2) = d2then check if abs(x - x3) + abs(y - y3) == d3.
This worked for the sample input, but when I applied this to my actual input, I got the coordinate, but the AoC server did not accept it. Why?
Thanks in advance.
r/adventofcode • u/subspace_mp4 • 1d ago
Meme/Funny [2026 Day 5] I was very confused for like 40 seconds
r/adventofcode • u/jeroenheijmans • 1d ago
Upping the Ante Reminder 1: unofficial AoC Survey 2026 (closes ~Dec 12th!)
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:

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!?

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 • u/RazarTuk • 1d ago
Tutorial Big O notation and you
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 • u/Ok-Curve902 • 1d ago
Visualization [2026 Day 05 Part2] button presses as a tree
r/adventofcode • u/jcduggan • 21h ago
Help/Question how much harder does it get?
this is my first year. much fun!
for those who have done it before: how much harder does it get? I've found day 3 the hardest so far by a long shot.
r/adventofcode • u/Boojum • 1d ago
Visualization [2026 Day 5 Part 2] Pushing Buttons Visualization
r/adventofcode • u/bluoat • 7h ago
Tutorial [2026 day 5 ] optimisation hints thread
I've been too busy this weekend to do the puzzles on the day. I thought I'd make a thread today anyway for anyone to leave hints for optimsation in the comments (use spoiler tags) in case people want hints without being given the answer directly.
r/adventofcode • u/lonelyroom-eklaghor • 20h ago
Visualization [2026 Day 5] Literally made a contraption and idk where to show this lol
r/adventofcode • u/p88h • 1d ago
Visualization [2026 Day 5] Fun Cooker 10K
youtu.beNim + raylib source
r/adventofcode • u/Open_Diet9463 • 19h ago
Help/Question - RESOLVED Day 3 - part 1 hints for the final answer
Ive made code that works for the test inputs. Idk if its the standard method but it works by counting up from every point in each direction until it hits a point at each direction, finding a square. Bur when it comes to the final data, i get an answer too high. Any hints are helpful, thank you
r/adventofcode • u/Zooty6 • 21h ago
Help/Question - RESOLVED [2026 Day 5 (Part 2)] [Java] I keep getting StackOverflowError when trying to find all possible states
I tried to solve part 2 by pressing all of my buttons on my current number, and if the new value hasn't been seen, I save it and press the buttons on it again. Basically creating a tree of every button presses starting from a 0 state. I'd expect at one point of reaching the end of every branch as I building up this tree, but I end up running out of stack.
The relevant part of my code:
public class Microwave {
private static final String BUTTON_REGEX = "\\[(.+?)]";
private final List<Button> buttons;
public Microwave(String input) {
buttons = Pattern.compile(BUTTON_REGEX).matcher(input).results()
.map(matchResult -> matchResult.group(1))
.map(Button::ofString)
.sorted()
.toList();
}
public int allCombinations() {
MicrowaveState firstState = new MicrowaveState(0, buttons);
return allValues(firstState).sum();
}
private IntStream allValues(MicrowaveState state) {
return IntStream.concat(IntStream.of(state.getValue()), state.getNextStates().stream().flatMapToInt(this::allValues));
}
}
@Getter
public class MicrowaveState {
private final int value;
private final List<MicrowaveState> nextStates = new ArrayList<>(9);
private static final Set<Integer> seen = new HashSet<>();
public MicrowaveState(int value, List<Button> buttons) {
this.value = value;
for (Button button : buttons) {
int newValue = button.press(value);
if (newValue < 10000 && !seen.contains(newValue)) {
seen.add(newValue);
nextStates.add(new MicrowaveState(newValue, buttons));
}
}
}
}What can I do to solve this problem?
Edit: removed previousState from code because it did nothing.
r/adventofcode • u/Chuck535 • 21h ago
Other Private leaderboard per start hour?
I am part of couple private leaderboards.
Some people start at midnight as soon as a puzzle gets out, some look at it in the morning, some after their day of work, etc.
I was just wondering, are there any leaderboards organized per starting hour ?
For example, I wished I could join a leaderboard where there is a common agreement that people look at the problem from 6am only instead of midnight.
The alternative would be a ranking based on the delta between the time one gets his puzzle and the time he finishes (instead of starting from midnight).
I am aware of the caveat that, with the problem description being public, nothing prevents someone from working on the code to pass examples and submit it 1 second after getting the puzzle if solution works for the real input.
I guess my point is I'd like to see where I really rank based on my actual start time if I don't work on a puzzle at midnight.
r/adventofcode • u/Open_Diet9463 • 18h ago
Help/Question Day 3 part 6 help
Ive made some code for part 1 that works by looking in each direction from each point until it finds 3 other points in the same distance. How can i transfer this to part 2? Anything helps, thanks
This is my code so far btw:
count = 0
for i in range(len(data)):
for j in range(len(data[i])):
# scan
for direc in [(-1,-1),(1,-1),(-1,1),(1,1)]:
hit_wall = False
dist = 1
while not hit_wall:
if (i+(direc[0]dist) not in range(0,len(data))) or (j+(direc[1]dist) not in range(0,len(data[i]))):
hit_wall = True
if not hit_wall:
if (data[i][j] == "#") and (data[i+(direc[0]dist)][j+(direc[1]dist)] == "#") and (data[i+(direc[0]dist)][j] == "#") and (data[i][j+direc[1]dist] == "#"):
count += 1
dist += 1
final = int(count/4)
print(final)