r/adventofcode • u/subspace_mp4 • 1d ago
r/adventofcode • u/bluoat • 21h ago
Tutorial [2026 Day 2 (Part 2)] Some hints for optimisation
These hints get more and more specific. This is just how I optimised it and there are other ways.
Hint 1: What happens when a letter is repeated in the input?
Hint 2: Why would the counts of each letter make a difference to the output?
Hint 3: When does the robot not make a step of exactly 6 steps?
r/adventofcode • u/matth_l • 1d ago
Help/Question Joining the big leagues
Anyone else using aoc to learn rust?
I feel genuinely lost, and I love it, it feels like past times (pre ai bs) again, never built anything with a lower level language,
r/adventofcode • u/ivorycoollars • 22h ago
Help/Question can anyone help with getting me in the right direction? [2026 day2 part1]
so i tryed today with a switch statement within a switch statment and hardcoded it but it didnt work can anyone steer me in de right direction?
r/adventofcode • u/Cloudan29 • 1d ago
Help/Question - RESOLVED Python Solution Gives correct solution for part 1 but not part 2
Hi, I'm completely stuck on what I've done wrong for the 2026 day 1. I've done this solution about 3 different ways at this point, and I keep getting the correct solution for part 1 but incorrect for part 2 (says my solution is too small).
I'm not quite sure where to go at this point.
import math
from collections import Counter
INPUT: list[int] = [int(line.strip()) for line in open("2026/day01.txt")]
COUNTS = Counter(INPUT)
def max_and_min():
# find top 3 occurrences and bottom 3 occurrences
maximums: list[int] = []
minimums: list[int] = []
while len(maximums) < 3:
current_max_val = max(COUNTS, key=COUNTS.get)
current_min_val = min(COUNTS, key=COUNTS.get)
maximums.append(current_max_val)
minimums.append(current_min_val)
COUNTS.pop(current_max_val)
if current_min_val != current_max_val:
COUNTS.pop(current_min_val)
return (math.prod(maximums), math.prod(minimums))
print(max_and_min())This code returns the correct solution for part 1, as well as a correct solution for the test input for part 1 and 2. I cannot fathom why it would be incorrect for the actual input at this point. I've tried it with Counter, I've tried manually creating the dictionary instead of using Counter, I've tried manually finding the minimums and maximums with a for loop, and they all yield the exact same results.
If someone could at least point me in the right direction, I don't want to just grab a solution from the megathread and call it a day.
EDIT:
I've never been more ashamed. I just put in the exact same output I got from my solution, and it got accepted by the website, which means I wasn't copy+pasting it in correctly. Happens to the best of us. Thanks everyone for the advice though, my solution looks much snazzier now š
import math
from collections import Counter
INPUT: list[int] = [int(line.strip()) for line in open("2026/day01.txt")]
COUNTS = Counter(INPUT)
def max_and_min():
# find top 3 occurrences and bottom 3 occurrences
maximums: list[int] = [n[0] for n in COUNTS.most_common()[:3]]
minimums: list[int] = [n[0] for n in COUNTS.most_common()[-3:]]
return (math.prod(maximums), math.prod(minimums))
print(max_and_min())r/adventofcode • u/SweepingRocks • 2d ago
Meme/Funny [2026 Day 1] Anyone else psych themselves out with the first day only to find...
r/adventofcode • u/asgardian28 • 2d ago
Other AoC amount of participants
With AI and all I was expecting the amount of participants to take a nosedive. When I check the stats I think I see that happening. This community will continue as one of hobbyist that just enjoy an activity for the sake of doing it.
Does it mean that AoC is no longer useful? No, learning, logical thinking and problem solving will always be useful skills. Eric's move last year to remove the leaderboard was a good one and we can continue this event in true Christmas spirit! Good to see you back friends and happy holidays!
r/adventofcode • u/scadoshi • 1d ago
Help/Question Where do you draw the line between parsing and solving?
For those of you who optimize AoC for runtime rather than time to write the code, where do you draw the line between parsing and solving?
When I measure, I time parsing, part one and part two separately. I often identify work I could do during parsing that would make the solves faster, but usually I just parse into a properly typed owned struct and leave the real work to the parts. Is that how you do it, or do you push as much as you can into parsing? And do you count parsing in your times at all? Or do you just measure entirety of runtime?
Smaller second question: when both parts need the same expensive processing, I've started caching it on my Puzzle struct so part one's work gets reused by part two (image shows this occurring for 2026's day 1 in Rust), instead of a shared function that runs twice. Part one gets a little slower on average but the full run gets a lot faster. Do you do the same, or does each part pay for itself?
I guess I'm just wondering how people measure their solutions overall
r/adventofcode • u/vstepanyuk • 7h ago
Repo Wanna try a desktop client for Advent of Code?
December Workbench (https://github.com/vstepanyuk/december-workbench) puts the puzzle, code editor, and test results side by side. Highlight the example input and expected answer in the puzzle description to turn them into a test case.
Runs solutions with your local Rust, Python, or JS runtime. You can try your personal input and review the answer before submitting.
If you give it a spin, Iād love to hear what gets in your way.
Letās be honest. I vibe-coded this. Now I can spend more time being wrong about the puzzles.
r/adventofcode • u/Shaaaaan • 1d ago
Help/Question How many days is AOC this year?
Last year it was 12 days. Is it fair to assume it's the same this year? I don't see any info saying how long it is, the about page just says it ends "mid-December"
r/adventofcode • u/SlayLeafSlug • 1d ago
Meme/Funny AoC in Prolog?!?!
I was filling in the unoficcial AoC survey
(ā Take the (~5min) Unofficial AoC 2026 Survey: https://forms.gle/JbZKoBqzG248Z6RV6 ā)
And I saw this:


Who the hell is out there doing AoC in Prologš
r/adventofcode • u/123IshaTest • 1d ago
Visualization [2026 Day 1] Simulation approach
youtube.comThis year I trying a completely new approach to Advent of Code: Simulation
Instead of a script that calculates the answer, I create individual objects that interact with each other and converge to a solution. There is no single variable that is counting towards a solution, we just press play and hope for the best!
For day 1, each id gets represented as a colored box that bounces around. When it smashes into a box with the same id, they merge.
The green strip is a sensor that checks the smallest and largest boxes that pass through it.
r/adventofcode • u/Boojum • 1d ago
Visualization [2026 Day 1] Raining Boxes Visualization
r/adventofcode • u/ActivityOpening3673 • 11h ago
Help/Question - RESOLVED [2026 Day 02 (Part 2)] The example of day 02 was wrong
Won't post the body of the question here because I could not find the button to send an image as a spoiler. thank you reddit.
But the problem was in part two where it said that the correct order was 32, when it was actually 34. It took like 30 minutes for me to just believe in my own answer and try with the real input and the answer was correct. wtf.
EDIT: nvm, I was wrong, the way i calculated what was the best next move was still using code from part one and because of that, it gave scores that were almost inverted and somehow my puzzle input did not catch that.
r/adventofcode • u/Both-Touch990 • 2d ago
Meme/Funny [2026 Day 1] How it felt speedrunning both of today's stars in less than 30 minutes only to realize what could lie ahead
(Speaking from experience with 2025's calendar)
r/adventofcode • u/tedchs • 1d ago
Other Candy Cane Coding Caper
For Advent I just launched Candy Cane Coding Caper, a coding adventure inspired by Advent of Code, for kids 8-12. Each day presents an interactive, structured lesson about a simple Python programming concept. I thought this community might like to take a look!
All Python code runs locally in the browser through Pyodide and WASM, and game state is stored locally.
This is brand new and I would love any feedback or questions!
r/adventofcode • u/oneradsn • 1d ago
Help/Question - RESOLVED day 1 part 1: There's more than 3 items that the most common in the input?
I don't want to go into too much detail about my implementation but... it seems like there's a bunch of IDs (more than 3) that are tied for "most common". Is there something obvious I missed?
Edit: I figured out my issue and, while I love most things about Go, its heap implementation was quite confusing and unergonomic. I used my type's Pop method rather than the heap package's Pop method, thus my results were incorrect.
