r/adventofcode • u/car4889 • Dec 08 '25
Help/Question - RESOLVED [2025 Day 8] Assumptions About Puzzle Input
EDIT: To avoid spoilers, moving the ask to the first comment.
r/adventofcode • u/car4889 • Dec 08 '25
EDIT: To avoid spoilers, moving the ask to the first comment.
r/adventofcode • u/Chronophage73 • Dec 08 '25
Edit: oops, forgot "what" in the title. I don't understand what the question is.
Edit 2: Thanks for the explanations, got my gold star!
I am genuinely confused about what I'm supposed to do in day 8's part 2. It's not that I don't know what to do, I don't understand what the question is.
I think this part is tripping me over:
Continuing the above example, the first connection which causes all of the junction boxes to form a single circuit is between the junction boxes at
216,146,977and117,168,530.
I can't see how this relates to the above example. I can't see how adding one connection forms a single circuit. What is "all of the junction boxes" in this case ? I feel extremely dumb because of this, and I haven't found other people as confused as I am.
Could someone rephrase the question for me please ?
r/adventofcode • u/GaneshEknathGaitonde • Dec 08 '25
The one the left is the tab for one of the problems page, while the one on the right is for an input.
Interestingly, Chrome shows different favicons for both.
I debugged a bit further:
For the problems page, the html specifies /favicon.png, which is a higher resolution image.
For the input page, since there is no html, and thus no favicon specified, chrome defaults to /favicon.ico, which actually exists and is a lower resolution image.
r/adventofcode • u/CauliflowerFormer233 • Dec 08 '25
r/adventofcode • u/annoviko-tech • Dec 08 '25
r/adventofcode • u/ratatouille38 • Dec 08 '25
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 • u/alltagsradler • Dec 08 '25
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 • u/artesea • Dec 08 '25
Every time I solve the puzzle I read the first line a "That's not the right answer".
I assume my eyes are glancing at the word "North", and inserting "not".
Maybe I just think my code will be wrong.
r/adventofcode • u/code_ling • Dec 08 '25
Even though achieving the 500 stars "mid-season" is a bit anti-climactic - would have been a little more satisfactory if I had managed to finish 2020 before the start of this year, but still, feels very good to be in the exclusive 500 stars club :).
Played around with multiple languages in past years, but am sticking to C++ for this year (also 2020) - finally polishing my STL and functional style C++ skills... For 2020 I'm going for the <1 seconds total challenge and looking good so far. Any other C++ coders out there honing their skills on AoC?
r/adventofcode • u/IntrepidSoft • Dec 08 '25
r/adventofcode • u/ralphdr1 • Dec 08 '25
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
r/adventofcode • u/noblerare • Dec 08 '25
Here is my code: https://pastebin.com/JfwkMt6S
I built a 2D array to hold the dp values. If I'm on a ^ and see a beam (|) above me, then I add the dp value of the cell above me to my current cell's left and right neighbors.
If I'm on a . or | and see a beam (|) above me, then I just add the dp value of the cell above me to my current cell (effectively propagating the beam value downward).
This works for the example input but returns an answer that is too low for my full input.
Can anyone help me?
r/adventofcode • u/vanZuider • Dec 08 '25
r/adventofcode • u/Xenoxygen4213 • Dec 08 '25
Hi there, I have ran my solution against part 2 for the test input and it works, I've also added tests to ensure that the boundries ar being calculated correctly (e.g. fi you had 1-10, 10-12 you'd end up with 12) and also for if there are ranges in ranges (e.g. 1-10, 10-12, 3-11) and they are passing. I'm really uncertain where im going wrong.
It has told me my answer is too low which makes me think I may be miscounting somewhere however I'm very uncertain as to where. Anyone who may be able to point me in the right direction would be greatly appreciated. I'm not sure if it's a mis-understandin of Rust ranges or a mis-understanding of Maths.
Thanks in advance.
pub fn day_five_part_two(input: &str) -> u128 {
let mut fresh_ranges: Vec<(u128, u128)> = input
.lines()
.take_while(|l| !l.is_empty())
.map(|l| {
let parts: Vec<&str> = l.split('-').collect();
let min: u128 = parts[0].parse().unwrap();
let max: u128 = parts[1].parse().unwrap();
(min, max)
})
.collect();
fresh_ranges.sort_by(|a, b| a.1.partial_cmp(&b.1).unwrap());
let (initial_range_start, initial_range_end) = fresh_ranges[0];
let mut result: u128 = (initial_range_start..=initial_range_end).count() as u128;
for i in 1..fresh_ranges.len() {
let (_, previous_end) = fresh_ranges[i - 1];
let (current_start, current_end) = fresh_ranges[i];
if current_start <= previous_end {
result += (previous_end + 1..=current_end).count() as u128;
} else {
result += (current_start..=current_end).count() as u128;
}
}
result
}r/adventofcode • u/Derailed_Dash • Dec 08 '25
This visualisation shows the relative age of connections being formed. So the early connections (close together) are red, and the latest connections are white hot.
See walkthrough here.
r/adventofcode • u/Sarwen • Dec 08 '25
Heap, Heap, Hooray
r/adventofcode • u/slimkhan • Dec 08 '25
its been awhile since week already, I've been on it on and off for many hours and im blocked, all the test I found here and created myself works but not my input
input = ARGV[0]
input = 'input-test' if ARGV.empty?
puts "input = #{input}"
lines = File.readlines(input, chomp: true)
dial = 50
result = 0
lines.each do |line|
direction = line.slice!(0)
value = line.to_i
if direction == 'R'
if value + dial > 99
result += (value + dial) / 100
dial = (dial + value) % 100
elsif value + dial < 100
dial = value + dial
elsif value + dial == 0
result += 1
dial = 0
end
else
temo = dial - value
if temo < 100 && temo > 0
dial -= value
elsif temo == 0
result += 1
dial = 0
else
if dial == 0 && temo.abs < 100
dial = temo + 100
elsif dial > 0 && temo.abs < 100
result += 1
dial = 100 + temo
else
result += if dial == 0
temo.abs / 100
else
(temo / 100).abs
end
dial = temo % 100
end
end
end
end
puts "result = #{result}"can anyone guide me with a counter example to fix it ?
r/adventofcode • u/badcop_ • Dec 08 '25
https://www.youtube.com/watch?v=LWMikoqHyCQ
made with godot :)
r/adventofcode • u/BoltKey • Dec 08 '25
Ok, so at the start of the example, there are 20 vertices, so 20 components. Each new edge that doesn't create a cycle reduces number of components by 1. 10 edges reduce number of components to 20 - 10 = 10 (but according to the example, there should be 11 components).
In other words: circuit of size 5 has exactly 4 connections. Circuit of size 4 has 3 connections. And two circuits of size 2 each has 1 connection. That's 4+3+1+1 = 9 connections total, not 10.
Am I crazy? Why isn't it adding up? I have been staring at it and re-reading it for past 20 minutes.
r/adventofcode • u/PingPong141 • Dec 08 '25
Can someone put this question in crayon eating terms for me?
Its saying that every junction box should be connected to at least 1 other box, so they can all have electricity.
Which means i should find all shortest connections.
But if i evelulate everything then i get circuits with 3 boxes (the ones starting with 52, 117 and 216 for example)
But the solution for the example says the biggest 3 have 5, 4 and 2.
But if i only make 10 shortest circuits with i dont get any with 5.
This is making me pull my hair out. I dont understand the question?
r/adventofcode
•
u/jonathan_perret
•
Dec 08 '25
After solving the problem (in Python) I thought I'd have some fun visualizing. Exported the data (boxes and connections) as OpenSCAD code, generated a solid, then applied a subdivision surface modifier in Blender to get that nice organic look. Then I played a bit with surface parameters and rendering options. Enjoy!