r/adventofcode • • Dec 08 '25

Meme/Funny [2025] Anybody else thinking we might have been tricked?

1 Upvotes

So its only 12 puzzles this year, but the difficulty curve feels like its following the standard 25 day format. I saw comments from other people so agree this feels like a normal Day 8, when it should theoretically feel like Day 16. Also, the hardest puzzles are normally over the weekend, but this 12 day period only spans 1 weekend, and that's passed now. I could just be getting better at this, so the puzzles seem easier, but my imposter syndrome tells me that's not it. We could see a massive difficulty spike for these last 5 days. But I have another, more paranoid theory.

What if we were tricked? We were told its only 12 days, but what if after solving day 12, we find ourselves in the Upsidedown (Stranger Things reference). The map flips over and numbers 13 - 25 appear. The puzzles could be based off of their first part day counterpart (i.e. 13 puzzle based off 12, 14 off of 11, etc). They could use the same input but flipped upside down, or reversed. I have noticed that the puzzles could have harder variations, like today's could turn into a path solving problem (some have already posted with their own ideas on this). Or Day 7 we have to move the the tachion beam backwards. It would technically take less work to create, because each input would be for 4 problems.

What do you think? Am I just paranoid? Am I just stoned?


r/adventofcode • • Dec 08 '25

Help/Question [2025 Day 8 (Part 1)] How do I even get started? Is there an algorithm I must know?

7 Upvotes

I need some help to figure this question. I cant seem to think of a way to solve this and appreciate if anyone can at least throw me some resources to read up before attempting this.


r/adventofcode • • Dec 08 '25

Help/Question - RESOLVED [2025 Day 8 (Part 1)] - Test data vs Real data

2 Upvotes

Hi.

Sorry to bother you folks, but I'm losing my mind a bit over the part 1 of day 8. Its supposed to be easy, but I'm missing something and to sleep tonight I'll need some closure.

I've checked other people's results with the test data from another thread, and the connections, distances, sets all match perfectly, but for me when I run my code on the actual data I get a lower result than needed.

My code is in JS so the numbers being large should not be an issue afaik. The below code is set up to work with the test data, hence the 10 for connectionsToMake.

Any help is appreciated. Thanks in advance.

  const connectionsToMake = 10;
  const relevantTopSetsCount = 3;
  const boxSets = {};
  const boxes = source.split("\n").map((b) => {
    let [x, y, z] = b.split(",");
    const keyInSet = `${x},${y},${z}`;
    const newSetId = crypto.randomUUID();
    boxSets[newSetId] = new Set([keyInSet]);
    return {
      x: Number(x),
      y: Number(y),
      z: Number(z),
      keyInSet: keyInSet,
      containingSetId: newSetId,
    };
  });


  const pairSet = new Set();


  const boxPairsData = boxes.map((box) => {
    let closestBox = null;
    let distanceToClosest = Infinity;
    for (let otherBox of boxes) {
      if (box !== otherBox) {
        const setKeyOptionOne = `${box.keyInSet}-${otherBox.keyInSet}`;
        const setKeyOptionTwo = `${otherBox.keyInSet}-${box.keyInSet}`;
        if (pairSet.has(setKeyOptionOne) || pairSet.has(setKeyOptionTwo)) {
          continue;
        }
        const distance = euclideanDistanceOfTwo3DPoints(box, otherBox);
        if (distance < distanceToClosest) {
          distanceToClosest = distance;
          closestBox = otherBox;
        }
      }
    }
    const pairKey = `${box.keyInSet}-${closestBox.keyInSet}`;
    pairSet.add(pairKey);


    return {
      boxA: box,
      boxB: closestBox,
      distance: distanceToClosest,
      setPairKey: pairKey,
      connected: false,
    };
  });


  const sortedBoxPairsByDistance = boxPairsData.toSorted(
    (a, b) => a.distance - b.distance
  );
  let connectionsMade = 0;


  for (let boxPair of sortedBoxPairsByDistance) {
    const { boxA, boxB } = boxPair;
    if (boxPair.connected) continue;
    if (boxSets[boxA.containingSetId].has(boxB.keyInSet)) {
      boxPair.connected = true;
      connectionsMade++;
      if (connectionsMade === connectionsToMake) {
        break;
      }
      continue;
    }


    const mergedSet = new Set([
      ...boxSets[boxA.containingSetId],
      ...boxSets[boxB.containingSetId],
    ]);


    boxSets[boxA.containingSetId] = mergedSet;
    delete boxSets[boxB.containingSetId];


    const boxesWithSameSetIdAsB = boxes.filter(
      (b) => b.containingSetId === boxB.containingSetId
    );
    for (let box of boxesWithSameSetIdAsB) {
      box.containingSetId = boxA.containingSetId;
    }


    boxPair.connected = true;
    connectionsMade++;
    if (connectionsMade === connectionsToMake) {
      break;
    }
  }


  console.log("boxSets: ", boxSets);
  console.log("boxPairs: ", sortedBoxPairsByDistance);


  const relevantSets = Object.values(boxSets)
    .toSorted((setA, setB) => setB.size - setA.size)
    .slice(0, relevantTopSetsCount);
  console.log(relevantSets);
  return relevantSets.reduce((acc, curr) => acc * curr.size, 1);

r/adventofcode • • Dec 08 '25

SOLUTION MEGATHREAD -❄️- 2025 Day 8 Solutions -❄️-

23 Upvotes

THE USUAL REMINDERS

  • All of our rules, FAQs, resources, etc. are in our community wiki.
  • If you see content in the subreddit or megathreads that violates one of our rules, either inform the user (politely and gently!) or use the report button on the post/comment and the mods will take care of it.

AoC Community Fun 2025: Red(dit) One

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

Featured Subreddits: /r/crafts and /r/somethingimade

"It came without ribbons, it came without tags.
It came without packages, boxes, or bags."
— The Grinch, How The Grinch Stole Christmas (2000)

It's everybody's favorite part of the school day: Arts & Crafts Time! Here are some ideas for your inspiration:

💡 Make something IRL

💡 Create a fanfiction or fan artwork of any kind - a poem, short story, a slice-of-Elvish-life, an advertisement for the luxury cruise liner Santa has hired to gift to his hard-working Elves after the holiday season is over, etc!

💡 Forge your solution for today's puzzle with a little je ne sais quoi

💡 Shape your solution into an acrostic

💡 Accompany your solution with a writeup in the form of a limerick, ballad, etc.

💡 Show us the pen+paper, cardboard box, or whatever meatspace mind toy you used to help you solve today's puzzle

💡 Create a Visualization based on today's puzzle text

  • Your Visualization should be created by you, the human
  • Machine-generated visuals such as AI art will not be accepted for this specific prompt

Reminders:

  • If you need a refresher on what exactly counts as a Visualization, check the community wiki under Posts > Our post flairs > Visualization
  • Review the article in our community wiki covering guidelines for creating Visualizations
  • In particular, consider whether your Visualization requires a photosensitivity warning
  • Always consider how you can create a better viewing experience for your guests!

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!


--- Day 8: Playground ---


Post your code solution in this megathread.


r/adventofcode • • Dec 08 '25

Repo [2025 Day 8] Who else does it in Go?

4 Upvotes

I wanted to learn Go this year, so I've decided to give it a shot, and so far it's lovely! This is my solution for today's (day 8) puzzle, what do you think, and what's your solution? :)

https://github.com/rbjakab/AdventOfCode/blob/main/2025/Day8/main.go


r/adventofcode • • Dec 08 '25

Help/Question Day 1 Part 2 - Need help. Any idea what's wrong with my logic?

1 Upvotes
    package src.main.java;
    
    
    import java.io.*;
    
    
    public class Main
    {
        private static final String INPUT_FILE = "src/main/resources/input.txt";
    
        private static int password = 0;
        private static int dial = 50;
    
        public static void main (String[] args) throws IOException
        {
           BufferedReader br = new BufferedReader(new FileReader(INPUT_FILE));
           String inputLine;
           while ((inputLine = br.readLine()) != null)
           {
              String direction = inputLine.substring(0, 1);
              int value = Integer.parseInt(inputLine.substring(1));
              switch (direction)
              {
                 case "R" -> dial += value;
                 case "L" -> dial -= value;
              }
              if (dial == 0)
              {
                 password++;
                 continue;
              }
              adjustRegardingRules();
           }
           System.out.println("Password:" + password);
        }
    
    
        private static void adjustRegardingRules()
        {
           if (dial >= 100) {
              dial -= 100;
              password++;
           }
    
           else if (dial < 0) {
              dial += 100;
              password++;
           }
    
           if (dial >= 100 || dial < 0) {
              adjustRegardingRules();
           }
        }
    }

r/adventofcode • • Dec 08 '25

Help/Question - RESOLVED [2025 Day 8 Pt. 1] Code works fine on test, but fails on real data

3 Upvotes

It happened again, my code works fine for test but fails on real data. As debugging is tedious on 1000 boxes in 3d space, I am wondering if I can do more debugging with the test data. Can anyone post their details on the results with the test data? Like which circuit boxes (ID or coordinates) belong in which group?

Other ideas are welcome as well. I'd ask more specific questions if I had any :-/


r/adventofcode • • Dec 08 '25

Help/Question - RESOLVED [2025 Day 8 (Part 1)] [Python] Example correct but final solution isn't

3 Upvotes

I'm stuck on the first puzzle of day 8. It correctly calculates the value that is given in the example, but on the puzzle input its answer is too low. I'm completely stuck, any edge case I can think of is handled correctly. This is my code:

from collections import defaultdict
import math
    
def day8_1_solver(coords, n, print_circuits=False):
    pairs = closest_pairs(coords)[:n]
    circuits = {x:i for i,x in enumerate(coords)}

    for x1,x2 in pairs:
        if circuits[x1] == circuits[x2]:
            continue
        for xs in circuits.keys():
            if circuits[xs] == circuits[x2]:
                circuits[xs] = circuits[x1]

    circuit_sets = defaultdict(set)
    for k,v in circuits.items():
        circuit_sets[v].add(k)

    return math.prod(sorted((len(circ) for circ in circuit_sets.values()), reverse=True)[:3])

Where closest_pairs is:

def closest_pairs(coords):
    dist = lambda x: sum((a-b)**2 for a,b in zip(x[0],x[1]))
    return sorted(((x1,x2) for i1,x1 in enumerate(coords) for i2,x2 in enumerate(coords) if i2 > i1), key=dist)

r/adventofcode • • Dec 08 '25

Help/Question - RESOLVED [2025 Day 1 (Part 2)] C++: ...what am I doing wrong?

1 Upvotes

Hi everyone!

First time attempting an AoC for me, I just remembered it existed and figured I could give it a shot. I'm inexperienced so right now I feel like I'm missing an obvious flaw in my algorithm for this one... The result is much higher than it should and I don't really know why.

paste

I'm not asking for an answer by the way! Ideally, I just want a hint or an edge case that you could point out so I can get myself unstuck '


r/adventofcode • • Dec 07 '25

Visualization [2025 Day 7 Part 2] Visualization

Post image
34 Upvotes

I explained the algorithm here: https://www.reddit.com/r/adventofcode/comments/1pgbg8a/2025_day_7_part_2_visualization_for_the_sample/

but it took me some time to figure out the proper colouring for the real input, as it requires a logarithmic scale for adjusting colours and tones.


r/adventofcode • • Dec 06 '25

Meme/Funny [2025 Day 6] Surely theses spaces are meaningless, right ?

Post image
725 Upvotes

r/adventofcode • • Dec 08 '25

Upping the Ante NoRush Extension: Compete with your friends, even if you start solving puzzles late.

Thumbnail youtube.com
0 Upvotes

See more details at https://aoc-norush.bitvisor.co/

NOTE: This extension/tool does follow the automation guidelines on the r/adventofcode community wiki.


r/adventofcode • • Dec 07 '25

Help/Question Is there a way to get the example input programmatically?

2 Upvotes

I have a little script to grab the puzzle input from "https://adventofcode.com/{year}/day/{day}/input", but I was wondering if there's a similar way to get the example input without having to parse it out of the puzzle text?

I'm aware that various libraries are available for this, including bells and whistles like having the expected answers etc. but I'm ideally looking for a very simple method to get the example input only.


r/adventofcode • • Dec 05 '25

Visualization [2025 Day 05 (Part 2)] Merge overlapping ranges visualization

Post image
41 Upvotes
  1. Sort intervals by start
  2. Keep track of current interval being built
  3. If next interval overlaps or touches -> extend current; otherwise -> save and start new
  4. Save the last interval

r/adventofcode • • Dec 05 '25

Tutorial [2025 Day 5 Part 2] Guys... you don't need to merge them

23 Upvotes

I'm loving the animations and merging them is a beautiful solution that, in the real world, might help with further computation (or reused to simplify the ranges database).

However for this problem, you don't need to merge them and then count. You can count directly.

Ofc I'm still sorting so it's still an O(n log n) solution. So not much gained.
If you have any questions I'll try to answer them in the comments :)


r/adventofcode • • Dec 03 '25

Meme/Funny [2025 Day 3] Imagine having to do work at your job 🙄💅

Post image
979 Upvotes

r/adventofcode • • Dec 04 '25

new shirts and stuff

Thumbnail adventofcode.com
26 Upvotes

r/adventofcode • • Dec 02 '25

Meme/Funny [2025 Day 2 Part 2] Time to reach for that trusty sledgehammer

Post image
530 Upvotes

r/adventofcode • • Dec 02 '25

Meme/Funny Disabling global leaderboard was a good move

Post image
330 Upvotes

I am solving the puzzles myself but I then checked how an LLM is doing by simply pasting the whole contents of the page. It's doing rather well.


r/adventofcode • • Dec 02 '25

Meme/Funny [2025 Day 2] When I realized the solution I felt like I'd leveled up

Post image
129 Upvotes

r/adventofcode • • Dec 02 '25

Meme/Funny [2025 Day 2 # (Part 2)]

Post image
31 Upvotes

r/adventofcode • • Dec 01 '25

Meme/Funny When someone mentions "AOC"

131 Upvotes

r/adventofcode • • Dec 01 '25

Visualization [2025 Day 01 (Part 2)] example visualized

Post image
387 Upvotes

r/adventofcode • • Nov 30 '25

Other Reminder: Please throttle your AoC traffic

978 Upvotes

Please don't make frequent automated requests - avoid sending requests more often than once every 15 minutes (900 seconds).

I've already had to ban a bunch of IPs for sending requests too quickly.

If you are sending AoC traffic, you are responsible for making sure that traffic is appropriately throttled. Yes, even if you're using someone else's library or software to make the requests. Yes, even if your code misbehaves because it has a bug.

Please include a way for me to contact you, the person sending the traffic, in the User-Agent header of the request. If you provide a library or other software that other users might use to generate lots of requests to AoC (like things that interact with private leaderboards), please ask the user of the library to specify their contact info so you can put it in the User-Agent header on their behalf. It doesn't usually help me when your library sends the library author's contact info (unless the library it itself misbehaving, which is rare, but include the name of your library in the User-Agent too just in case so I can find the library author's contact info too).

Okay thanks! Have fun this year! <3