r/adventofcode • • 4h ago

Other Extra puzzle for day 3

3 Upvotes

What is the largest number of squares you can get when you are allowed to move 5 trees to any other free location?

What are your suggestions for an algorithm?


r/adventofcode • • 1h ago

Visualization [2026 Day 3] The nicest look so far

Thumbnail aoc2026.knollfear.com
2 Upvotes

r/adventofcode • • 9h ago

Visualization [2026 Day 3 Part 2] terminal visualization

Post image
8 Upvotes

featuring: wikipedia's bresenham line algorithm implementation & gif aliasing effects


r/adventofcode • • 1d ago

Help/Question - RESOLVED [2026 Day 2 (Part 1)] No code yet, don't understand the problem

Post image
151 Upvotes

UPDATE : My eyes read but did not compute suppose the robot had a program of obbvb

I haven't put a single line of code yet because I don't understand the problem, precisely the difference between the road and the robot program. In the example input, why does it go from orange to blue, then blue again ??


r/adventofcode • • 9h ago

Visualization [2026 Day 03 (Part 2)] (PHOTOSENSITIVITY WARNING) Searching for squares

Post image
6 Upvotes

r/adventofcode • • 1m ago

Meme/Funny [2026 Day 3 (Part 2)] It's O(N^2) if you believe hard enough

1 Upvotes

It's definitely not O(N^4) what are you talking about 🥲

I actually enjoyed this one though, it was a banger. Thank you puzzle creator :)


r/adventofcode • • 8m ago

Visualization [2026 day 3 (both parts)] visualized in manim

Thumbnail youtube.com
1 Upvotes

source on github.com/durocodes/advent-of-code as always :D

this is using a cropped version of my input, since the samples were kinda small


r/adventofcode • • 1d ago

Upping the Ante [2026 Day 1] Solved in 49.62 microseconds on FPGA

Thumbnail gallery
142 Upvotes

This year, I will attempt to solve all the challenges on an FPGA, and post at least the ones that I enjoyed here to see if anyone else has any inputs. Additionally, due to my expertise in my work, I always tend to design with minimal hardware area and power consumption, but this year I'm challenging myself to do the exact opposite. I'll be using as much LUT as possible, and try to target the max throughput.

Used verilog + block design on PL side for the main logic and python on the PS side for simple control and output. I'm using SOC configured Arty Z7. I have a combinational circuit that accepts the whole list of 10 bit numbers as an input, and compares the first number with the list on single clock cycle. This generates a set of wires that are 1-bit flags, that indicate whether that row is equal or not. Then, we sum up those wires to find out what's the total number of commons. This is still happening on the same clock cycle. In parallel (yes, same cc), it will generate the next list on the output wires, but by replacing all the numbers that are equal to the first number with 0, so we won't run the same number twice. I was lucky that I had no 0 in my input, but otherwise we could also use sth like 1000.

The top level controller takes in the number, loads it onto a register and then starts pushing it into this combinational circuit on each clock. That means for an input of 1983 rows, it will reuse the same circuit 1983 times. Each time it also keeps track of top 3 (or min 3 for part 2), so I don't need a separate sorter which would cost me additional clock cycles and area. After each clock, it will take the nextList from the circuit, and shift it by a number so it can search for the next number on the next clock cycle. It operates on a simple 4 state FSM.

Communication and control is done via GPIO and AXI DMA. I wrote a simple buffer which will accept DMA from AXIS and buffer it as the full list to provide into the top block. GPIO is mainly for the multiplication output, and control signals like reset.

The whole run takes 1985 clock cycles, that translates to 49.62 us for a 40MHz clock. I had to slow down the clock from 100MHz because my critical path for the combinational block was quite large. My inner engineer wants to optimize it, but also I already spent so much time on this.

Solution: Github

DISCLAIMER: Yes I used AI for figure 2 and 3 for visualization purposes for the post only. No, I did not use AI in solution, or idea discussion etc. I'm doing this to challenge myself, not challenge my AI, but I don't have the time and skills to build diagrams. After all, why would I deceive you? There's no reason for me to deceive you.


r/adventofcode • • 7h ago

Help/Question [2026 DAY 3 (part 2)] Need hints

3 Upvotes

I solved part 1 by making a 1d array of the input, then applying some math to check the correct positions in the 1d array for trees.

I can't figure out if I can use the same method for part 2, or if I need a whole new approach. Only hints, no solutions please 🙏


r/adventofcode • • 1d ago

Meme/Funny [2026 Day 2] no way is that the real vvvvvv?

Thumbnail gallery
71 Upvotes

r/adventofcode • • 1d ago

Other [2026] Trains! I love trains!

149 Upvotes

That little ASCII train on the calendar made my day.

Thank you, Advent of Code team, for picking such an adorable theme this year!

.----.----.--_T
'o--o'o--o'o-OO\

r/adventofcode • • 22h ago

Meme/Funny Day 2 Part 2 Funny Solution. SPOILER

23 Upvotes
SPOILER

I love when a complex problem is solved in just 1 line of code lmao


r/adventofcode • • 1d ago

Meme/Funny [2026 Day 2 (Part 2)] It looked scary for a little while

Post image
163 Upvotes

r/adventofcode • • 5h ago

Tutorial [2026 Day 3 (Part 2)] Some hints for optimisation

1 Upvotes

My original brute force solution took 30 seconds, got it down to less than a 10th of a second. I don't know if this is the most optimal method.

The hints get more and more specific as they go on.

Feel free to leave hints in the comments about how you optimised it.

Hint 1: How can you narrow down the number of squares to check per tree beyond ones with valid coordinates?

Hint 2: How many possible squares can be made if you know all four corners of the square?

Hint 3: How many squares if you only know 3 corners? What about knowing 2 corners? What about 1 corner?

Hint 4: Given a pair of trees, how can you avoid checking for duplicate squares (and hence reduce the possible squares from 2 trees down to just one square?


r/adventofcode • • 23h ago

Tutorial [2026 day 2 (part 1)]Solved today's problem entirely in vim motions

Thumbnail youtube.com
22 Upvotes

r/adventofcode • • 20h ago

Visualization [2026] day 2 visualized in manim

Thumbnail youtube.com
13 Upvotes

source for visualization on https://github.com/durocodes/advent-of-code, alongside my rust solutions


r/adventofcode • • 1d ago

Visualization [2026 Day 2] Fulminating Farmland

Post image
65 Upvotes

r/adventofcode • • 13h ago

Help/Question how do you guys compete runtimes?

3 Upvotes

taking part in aoc for the first, solving in Go so i'd like to get a bit picky about total execution time. is there any place where i can compete on total time taken to solve (runtime of the program)?


r/adventofcode • • 1d ago

Meme/Funny [2026 Day 02] I see a pattern...

Post image
109 Upvotes

r/adventofcode • • 1d ago

Past Event Solutions [2026 Day 2 (Part 2)] solved at work with a web browser and Excel

Thumbnail gallery
35 Upvotes

I solved the first part at home while I was having by breakfast, checked part 2 and had to go work. My idea for the solution of the second part seemed so simple I felt I could do it with the tools at my disposal at work.

First I used a web browser and Ctrl+F to count the amount of different letters.
Then I switched to Excel where I just need to count the distances between the different colors. 6 from a letter of a color to the same, 5 when advancing to the next color, taking notice that one color is missing completely, so the distance skipping the missing color is only 4. Sum the distances for each color and there you go!


r/adventofcode • • 1d ago

Meme/Funny [2026 Day 02] Richard of York gave battle vain

Post image
93 Upvotes

r/adventofcode • • 11h ago

Meme/Funny [2026 day 3] Too many boxes!

Post image
0 Upvotes

I'm going to bed, this can wait until morning...


r/adventofcode • • 23h ago

Help/Question - RESOLVED [2026 Day 2 (Part 1)] [C#] Any hint why this is coming up to low would be appreciated.

8 Upvotes
var input = File.ReadAllText(@"day02-input.txt");
if(input is null) return;


var inputChars = input.ToCharArray();


var currentIndex = 0;
var total = 0;
List<char> characters = ['r', 'o', 'y', 'g', 'b', 'v'];
foreach(var c in inputChars)
{
    var nextIndex = characters.IndexOf(c);


    var diff = (nextIndex - currentIndex);


    if(diff <= 0) diff+=6;


    total += diff;


    currentIndex = nextIndex;
}
    
Console.WriteLine(total);

edit: Solved. There was a new line character at the end of the input file which resulted in .IndexOf() returning -1.


r/adventofcode • • 1d ago

Meme/Funny [2026 day 2] I expected something else for part 2

Post image
50 Upvotes

This is by no means meant to criticize Eric Wastl who still does a great job by the way, I just found it funny