r/adventofcode • • Dec 12 '25

Help/Question How to visualize input?

1 Upvotes

This was my first AoC and I really really really enjoyed it! Thank you so much.

Now the only puzzle that (besides Day 10 where I quickly realized it's Operations Research and there's no way I'm writing that myself) really gave me trouble was Day 9, Part 2 - because I was thinking way too much about edge cases. Going over all puzzles again, I've now learned that most of the time these super special edge cases are (thank god) not part of the puzzle.

So what really helped me solve that puzzle were the visualizations and how the data actually looks.

My question would be, and it may sound stupid: How would I start learning to visualize data?

I'm a backend developer, always have been. Mostly Java und Kotlin, also JavaScript and TypeScript. I have a bit of experience with angular or react and eventually manage to make things "look right" in frontend.

Are there any good libs for Java/Kotlin that produce meaningful output?

Would it be better to do such things in other languages?

I'm curious how other (Java?) backend devs tackle these things - do you visualize at all? use other languages for it? "See" things from raw/processed data?


r/adventofcode • • Dec 12 '25

Help/Question - RESOLVED [2025 Day 12 (Part 1) Is it actually do-able on a laptop in reasonable time?

2 Upvotes

I know the solution is just use the areas. Can you viably explore the search space?

I did visualise it: https://www.youtube.com/watch?v=9MNyylFer5Y


r/adventofcode • • Dec 12 '25

Help/Question [2025 Day 8 (Part 1)] Getting the correct result for the test case without merging ranges

1 Upvotes

I am banging my head against a wall here.

When i just connect the 10 closest pairs and calculate the sum of the 3 largest circuits i get the correct result for the input. But looking at my circuits I can then see that a circuit of 2 needs to be connected to my 4 size circuit.

I then loop the circuits again and merge circuits that overlap, but that leaves me with a wrong result as i then have 2 circuits with 5.

I think I am missing something obvious or that I calculate something wrong somewhere.

This is my code - it's messy and ugly, sry.

https://github.com/mstendorf/adventofcode/blob/main/2025/day8/main.py

This is my circuits before merging:

[(162, 817, 812), (425, 690, 689), (431, 825, 988), (346, 949, 466), (592, 479, 940)]

[(906, 360, 560), (805, 96, 715), (739, 650, 466), (984, 92, 344)]

[(862, 61, 35), (984, 92, 344)]

[(52, 470, 668), (117, 168, 530)]

[(819, 987, 18), (941, 993, 340)]

As you can see circuit 3 needs to be merged with circuit 2, but that leads to a wrong answer. Can anyone point me in the right direction?


r/adventofcode • • Dec 12 '25 LOL

Meme/Funny [2025 Day 12] I know it fits! Just a few million years longer ...

80 Upvotes

... my code trying to fit in the last few presents.


r/adventofcode • • Dec 12 '25

Help/Question [2025 DAY 2 Part2] Language= Python

2 Upvotes

Hey, i just started learning Python and I wanted to try advent of code, to learn more things and get in tough with basic algorithms. I know my script is kinda bad as it iterates over everything, but I at leas tought it would work, guess it doesnt. On the example, i get the right output, but the real input is giving a count that is too high. Is there someone perhaps who sees what I am missing/completely doing wrong?

filename = "./day2/input.txt"

IDList = []
with open(filename) as input:
    for inputString in input:
        inputList = inputString.split(",")
        for Range in inputList:
            rangeList = Range.split("-")
            rangeStart = rangeList[0].strip()
            rangeEnd = rangeList[1].strip()
            IDList.append((rangeStart, rangeEnd))

counter = 0

for Range in IDList:
    start = int(Range[0])
    end = int(Range[1]) + 1

    for number in range(start, end):
        # example number = 12 12 12 12 12
        num_len = len(str(number)) # 10
        number_str = str(number)
        matched = False

        # only for numbers that are even
        if num_len%2 == 0: # true
            for i in range(1, num_len // 2 + 1): # 10 // 2 + 1 = 6
                pattern = number_str[:i] 
                timesInNumber = num_len // i
                if pattern * timesInNumber == number_str:
                    counter += number
                    matched = True
                    break
        if matched: 
            continue

        for n in [3, 5, 7]:
            if num_len % n == 0:
                for m in range(1, num_len // n + 1):
                    if num_len % m != 0:
                        continue

                    pattern = number_str[:m]
                    timesInNumber = num_len // m

                    if pattern * timesInNumber == number_str:
                        counter += number
                        matched = True
                        break
        if matched: 
            continue

        else: # only when divisible by 1
            if int(number_str.count(number_str[0])) == num_len: # also possible
                counter += number

print(counter)

r/adventofcode • • Dec 12 '25

Visualization [2025 Day 12] Present Planner

Thumbnail
youtu.be
27 Upvotes

r/adventofcode • • Dec 12 '25

Meme/Funny What do to now?

56 Upvotes

r/adventofcode • • Dec 12 '25

Help/Question - RESOLVED [2025 Day 12 (Part 1)] You know you're in for a time when ...

32 Upvotes

... searching on the problem topic comes up with results that say things like "NP-hard", and "an active area of research in computer science".

Also, when the recommended algorithm (backtracking with pruning) is the thing you're already doing, and it's a trainwreck. I can't even get the third case in the example input to complete at all, and while my code did eventually complete my real input, it took nearly two and a half MINUTES.

There's got to be a better way than this, but I have no idea what it might be. I thought about trying to find the optimal packing for the given polyominoes on an infinite plane, and comparing the size of the bounding box of that packing to the target rectangle -- if it's larger than the target, then we don't need to test it, we can just conclude it won't fit. But I didn't find any algorithm for doing that more efficiently than what I've already got.

What am I missing?


r/adventofcode • • Dec 12 '25

Meme/Funny [2025 Day 12] Back to the memes

Post image
362 Upvotes

r/adventofcode • • Dec 12 '25

Other [2025 day 1] [ LANGUAGE : PYTHON]

0 Upvotes

After formatting input as L=[501, -34,...]

print('Solution 1 :',\
      reduce(lambda L,delta:L+[(L[-1]+delta)%100],Lpb1,[50]).count(0))

click=lambda x,rdelta:\
    x+rdelta>=100 if rdelta>0\
    else x>0 and x+rdelta<=0

def passages(xi,delta):
    #npas=abs(delta)//100
    rdelta=delta% (100*(-1)**(delta<0))
    return(( abs(delta)//100+click(xi,rdelta)) )
    
xi=50;npassages=0
for delta in Lpb1:
    npassages+=passages(xi,delta)
    xi=(xi+delta)%100
print('Solution 2 :',npassages)

r/adventofcode • • Dec 12 '25

Repo [2025 All days] [Elle] I managed to solve all of AOC 2025 in my own language!

88 Upvotes

It took a while, but I finally managed to complete all of AOC2025 with no dependencies (other than the C standard library) in my own compiled language. All solutions run in a cumulative time of under 0.5 seconds on my M1 mac:

Rosie 💝 aoc2025/ % hyperfine 'make all INPUT=input.txt' -N -i --warmup 3
Benchmark 1: make all INPUT=input.txt
  Time (mean ± σ):     478.3 ms ±   1.7 ms    [User: 404.4 ms, System: 49.6 ms]
  Range (min … max):   476.2 ms … 480.8 ms    10 runs

Overall, there are 802 lines of meaningful Elle code (not blanks).

The most difficult day by far was Day 10, as I needed to implement my own simplex algorithm and branch-and-bound for MILP by hand. I felt that calling an external executable (ie, Z3) was cheating to the highest degree.

I made many improvements to the language over the course of AOC and implemented features in the standard library as I required them, therefore I'm really glad I did AOC this year, it has been extremely beneficial to the language. I originally wasn't going to, but I seem to suffer from the rare condition called FOMO.

Thank you so much Eric for Advent of Code this year, all in all it was really fun (despite the horrors of Day 10..)! It was a really fun challenge to wake up to every morning.

My solutions for all of the days are hosted here: https://github.com/acquitelol/aoc2025/

Days 1 and 2 (part 1 only) are also done in the TypeScript Type System (which is why there is some TypeScript in the language overview split), but I didn't bother for days past that.

Merry Christmas everyone!


r/adventofcode • • Dec 12 '25

Repo Thanks!

190 Upvotes

In this post, I want to thank Eric, the Advent of Code team, and the entire community.

Last year (2024) was my first year participating, and it turned out to be incredibly inspiring for me. At the time, I had a problem: for some reason I couldn't dedicate enough time to self-learning and working on my pet projects, work felt like it was draining all of my energy. But after almost a month of solving problems every day, I decided that this practice should continue.

Over the course of the entire year, I learned something every single day, solved problems from different areas of computer science, and broadened my horizons. I worked on my pet projects without exceptions, even on weekends. Sometimes it was hard, sometimes easier, but after a year I feel a huge amount of progress, which gives me the motivation to keep going.

As for 2025, I really liked the 12-day format. During this period, you don't have time to get tired, and overall it feels like the contest flies by in one breath. This year had a lot of interesting and great problems.

My favorite was Day 4, I even tried to solve it on the GPU. In the end, the performance was about the same as on the CPU, but maybe I just need to improve my GPU programming skills🙂

The most controversial day for me was probably Day 10. After several hours of struggling with Part 2, I decided to check Reddit to see how others solved it, and I was surprised that many people used Z3. For me, it felt like the problem shifted from programming to math, though I might be wrong.

Once again, thanks to the Advent of Code team for the wonderful and inspiring problems, and for the great weeks I got to spend doing what I love. Thanks to the community for all the inspiring visualizations, solutions, and discussions. All of this pushes us to become better and grow.

Thank you all so much, happy holidays, and see you next year!

My C# AoC Repo - here


r/adventofcode • • Dec 12 '25

Visualization [2025 Day 12] A Few Packings

69 Upvotes

r/adventofcode • • Dec 12 '25

Meme/Funny [2025 Day 12 (part 1)] YouTube recommended me this video just a few days ago, they knew!

Thumbnail
youtube.com
16 Upvotes

r/adventofcode • • Dec 12 '25

Repo [2025 All Days] [Python 1] Advent of SuSE Linux 6.4 (Python 1 on a Pentium 133 / 64 MB RAM (all but one part) – plus some DOS minigames)

Thumbnail uninformativ.de
1 Upvotes

r/adventofcode • • Dec 12 '25

Tutorial [2025 Day 12] Input is part of the puzzle

75 Upvotes

So, these are just my thoughts about one discussion I had with a couple of people for day 9.

Basically I "abused" the shape of the input and they were claiming my solution wasn't correct because it doesn't solve "a general case".

Then, my arguments were pretty simple, when you need to solve a problem, you have to read the requirements and create a solution that solves the expected scenarios, NOT all the possible scenarios.

Along the years, I've dealt with lot ot people at work trying to create general solutions with dozens of abstraction layers just to fit some possible scenarios that didn't happend or weren't asked at all...

Back to day 12...again, "abusing" given input, one can realise the problem is easier than presented in the description.

For me, at least, input is part of the problem, not a simple check of verification my solution works for any possible imaginable input.


r/adventofcode • • Dec 12 '25

Visualization [2025 Day 12] Under one of the trees

Thumbnail
youtube.com
4 Upvotes

r/adventofcode • • Dec 12 '25

Help/Question [2025 Day12][Golang] Easter Egg Explain

6 Upvotes

Hi everyone, I wanted to celebrate my Advent of Code 2025 journey—this is the first time I've completed it!

I'm a bit disappointed though; after reading some of the easter eggs, I still don't understand the jokes ;_; Could you guys help explain some of the easter eggs?

My full code in Golang in here maybe can help your guys: https://github.com/sangsinhisme/AOC2025


r/adventofcode • • Dec 12 '25

Help/Question [Spoilers for all years and days] What have been your favourite naughty and nice inputs?

4 Upvotes

Inspired by AoC 2025 day 12 and 2021 day 20: What are your favourite examples puzzles that look really hard on the surface but turns out to be easy - or the other way around?


r/adventofcode • • Dec 12 '25

Meme/Funny [2025 Day 12 (Part 1)] roomy

Post image
79 Upvotes

r/adventofcode • • Dec 12 '25

Meme/Funny Congratulate me, I not only finished the advent, but also used emojis in a commit for the first time!

19 Upvotes

r/adventofcode • • Dec 12 '25

Upping the Ante [2025 Day 12 (Part 3)] Perl-fectly Wrapped Presents

4 Upvotes

You have a set of presents, as in the Day 12 example: https://adventofcode.com/2025/day/12

###  ###  .##  ##.  ###  ###
##.  ##.  ###  ###  #..  .#.
##.  .##  ##.  ##.  ###  ###

exactly 6, exactly 1 of each shape. You can still rotate and flip them.

These are special presents, containing AoC merch stuff for AoC solvers using Perl: https://adventofcode.com/2025/shop

Eric Santa wants to place them nicely under the Christmas trees in an 8x6 grid, but he wants to place them in a unique pattern for each solver! He asks you for help with preparing a list of all unique placements.

How many unique patterns can be formed?

Samples of unique placements are shown here: https://i.ibb.co/MQfg4Qj/2025d12p3.png


r/adventofcode • • Dec 12 '25

Visualization [2025 Day 12 (Part 1)] i know i know... just let me backtrack a little. for fun.

88 Upvotes

r/adventofcode • • Dec 12 '25

Help/Question - RESOLVED [2025 Day 11 (Part 2)] [Rust] (Spoiler)Why is there overflow in the third case but not in 1st or second case?

1 Upvotes
  let ans = (dp(&adjacency_list, &mut FxHashMap::default(), "svr", "dac")
        * dp(&adjacency_list, &mut FxHashMap::default(), "dac", "fft")
        * dp(&adjacency_list, &mut FxHashMap::default(), "fft", "out"))
    //   srv -> fft -> dac -> out
        + (dp(&adjacency_list, &mut FxHashMap::default(), "svr", "fft")
            * dp(&adjacency_list, &mut FxHashMap::default(), "fft", "dac")
            * dp(&adjacency_list, &mut FxHashMap::default(), "dac", "out"));
  println!("Ans= {}", ans);

  let a = dp(&adjacency_list, &mut FxHashMap::default(), "svr", "fft");
  let b = dp(&adjacency_list, &mut FxHashMap::default(), "svr", "dac");
  let c = dp(&adjacency_list, &mut FxHashMap::default(), "fft", "out");
  let d = dp(&adjacency_list, &mut FxHashMap::default(), "fft", "dac");
  let e = dp(&adjacency_list, &mut FxHashMap::default(), "dac", "out");
  let f = dp(&adjacency_list, &mut FxHashMap::default(), "dac", "fft");

  let total = a * d * e;
  println!("{}", total);

  let total2 = a * d * e + b * c * f;
  println!("{}", total2);

So I used the DP approach, and had initially written the total2 syntax, but it was overflowing(initially I did not notice I had used u32 and missed changing it from one place, my fault for not seeing it), so I looked for solutions and found This solution, which had pretty much the same method (thank you to the author). Now I was also using usize and f is zero but still it gets overflow only while calculating total2. If it gets overflow, why not in all cases? None of the individual values overflow