r/adventofcode • u/blacai • 3h ago
r/adventofcode • u/daggerdragon • 4h ago
SOLUTION MEGATHREAD -❄️- 2026 Day 2 Solutions -❄️-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
AoC Community Fun 2026: The Advent Games
Today's Event: International Toboggan Championships
"Feel the rhythm, feel the rhyme, get on up, it's
bobsledtoboggan time!"
— Cool Runnings (1993)
Today's schedule possibly consists of:
- Tracking Chute Runs and Team Practice
- Embiggen is a perfectly cromulent word. Do with it as you will.
- Qualifying Runs
- Reverse code golf your solution
- (oblig XKCD)
- Second Runs and Finals
- Why use few word when many word do trick?
- Unnecessarily declare variables for everything and don't re-use variables
- Use unnecessarily expensive functions and calls wherever possible
- Implement redundant error checking everywhere
- Javadocs >_>
Request from the mods: When you include an entry alongside your solution, please label it with [Advent Games] so we can find it easily!
--- Day 2: Fulminating Farmland ---
Post your code solution in this megathread.
- Read the full posting rules in our community wiki before you post!
- State which language(s) your solution uses with
[LANGUAGE: xyz] - Format code blocks using the four-spaces Markdown syntax!
- Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
r/adventofcode • u/daggerdragon • 1d ago
Upping the Ante -❄️- Advent of Code 2026: The Advent Games -❄️- Submissions Megathread -❄️-
Advent of Code Community Fun 2026: The Advent Games
I will be your master of ceremonies for this year's community fun event: The Advent Games!
This year's community fun event features a structured sequence similar to a certain winter-themed international multi-sport competition that occurs every four years. We will have our opening ceremony, nine "sporting"† events, the grand gala, and the closing ceremony, followed by the final demonstration of exhibition pieces wherein all of you get to show off your hard-earned efforts for the year!
Every day, I will reveal an event in that day's Solution Megathread. Your challenge is to mold your puzzle solution around the theme of that day's event. You could also create some ancillary concoction that you think matches the overall theme of the event; even if you have to stretch suspension of disbelief real far, hey, it's all in good fun!
† Don't worry, I'm not going to make you actually exercise or go outside and touch grass (or snow)‡.
‡ Unless you want to, in which case go hog wild. Just make sure to put on your sunscreen and weather-appropriate gear!
Again this year the usual timeline and requirements are adjusted so you are not rushed by a shortened deadline while also dealing with the typically harder AoC puzzles near the end of an AoC season while also also dealing with holiday preparations, etc etc.
- Only three days of submissions to
Solution Megathreads are required to qualify for entry - More time after the actual AoC event ends to complete your exhibition piece
- Longer voting period
All of this should result in less stress and having more time to create your exhibition piece, more time to enjoy your holiday season, and most importantly: more time to spend with your family and friends!
And now… put your hands together for The Advent Games and GET HYPE!
COMPETITION SCHEDULE
| 2026 Dec | Time (EST) | Action |
|---|---|---|
| 01 | 00:00 | Opening Ceremonies (community fun announced) |
| 03 | 00:00ish | Submissions megathread unlocked |
| 12 | 00:00 | Closing Ceremonies (AoC 2026 event ends) |
| 17 | 18:00 | SUBMISSIONS DEADLINE |
| 17 | ASAP | Submissions megathread locked and voting opens (will post and sticky a PSA with link to vote) |
| 20 | 18:00 | Voting closes |
| 20 | ASAP | Victory Ceremonies (winners announced in the final community showcase post (and edited into Day 12's Solution Megathread)) |
JUDGING AND PRIZES
The Advent Games may technically be a Competition™ but really, everyone who participates is a true winner in our holiday hearts!
Types of Winners
| Type of Winner | # of Winners | Who Votes |
|---|---|---|
| Bronze Medalist | 10† | the AoC community (you!) |
| Silver Medalist | 3† | /r/adventofcode moderators + /u/topaz2078 |
| Gold Medalist | 1 | highest combined point total |
† Amounts subject to change based on availability and/or tie-breaking.
How Judging Works
- When voting opens, vote for your favorite exhibition piece(s). Your individual vote is worth 1 point each.
- When voting closes, the 10 highest-voted entries are declared
Bronze Medalists. - Of the 10
Bronze Medalists, each of the /r/adventofcode moderators will pick their top 3 to be awarded as aSilver Medalist.
- The votes of us lowly rank-and-file moderators (/u/daggerdragon and /u/Aneurysm9) are worth +3 points each while /u/topaz2078's votes are worth +5 each.
- All point totals are aggregated (community vote + mod vote). The highest combined point total will be officially declared as the
Gold Medalistof AoC 2026.
Rewards
- Winners are forever ensconced in the Halls of the /r/adventofcode wiki.
Bronze Medalists will be awarded with whatever Reddit has on tap for awards these days.Silver Medalists and theGold Medalistawards are TBD
REQUIREMENTS
- To qualify for entering, you must first submit code solutions to at least three different daily
Solution Megathreads
- There's no rush as this submissions megathread will unlock on December 03 and you will have until December 17 to submit your exhibition piece - see the timeline above
- Your exhibition piece must express the unique qualities of that day's scheduled event
- You must create the exhibition piece yourself (or with your team/co-workers/family/whatever - give them credit!)
- One exhibition piece per person
- Only new creations as of 2026 December 1 at 00:00 EST are eligible
- All sorts of folks play AoC every year, so let's keep things PG
- Please don't plagiarize!
- This also means adding a disclaimer if you use AI
- Ideally also consider including information such as which model(s), where it's used, what your prompts were, etc.
- Keep accessibility in mind:
- If your creation has images with text, provide a full text transcript
- If your creation includes audio, either caption the video or provide a full text transcript
- If your creation includes strobing lights or rapidly-flashing colors/images/text, clearly label your submission as per the
Visualizations rule
- Your submission must use the template below!
TEMPLATES AND EXAMPLES FOR SUBMISSIONS
Keep in mind that these templates are Markdown, so you may have to switch your editor to "Markdown mode" before you paste the template into the reply box.
TEMPLATE
Click here for a blank raw Markdown template for easier copy-pasting
Visual Example
NAME OF ENTRY: A photorealistic rendition of the arrival of the flame at the opening ceremony for the 2026 Advent Games
LINK TO ENTRY: Imgur
DESCRIPTION: I use the most high-tech tools to create a totally photorealistic rendition of a crayon drawing of the arrival of the flame at the opening ceremony of the 2026 Advent Games sponsored by Advent of Code.
SUBMITTED BY: /u/daggerdragon
MEGATHREADS: 02 - 03 - 05 - 11 - 17 - 19 - 23 - 32
ADDITIONAL COMMENTS: This was absolutely not drawn by /u/topaz2078 nope totally my work yep.
ACCESSIBILITY: A high-tech drawing on standard white printer paper of the final runner approaching the Advent Cauldron in the center of the Advent Games stadium with the lit torch of the Advent Games. In the background is a stadium full of cheering spectators. The drawing is surmounted by a bespoke artisanal IrfanView frame.
QUESTIONS?
Ask the moderators. I'll update this post with any relevant Q+A as necessary.
r/adventofcode • u/PatolomaioFalagi • 3h ago
Meme/Funny [2026 Day 02] Richard of York gave battle vain
r/adventofcode • u/dethorhyne • 13h ago
Meme/Funny Every year it always starts the same before it goes bonkers
r/adventofcode • u/topaz2078 • 8h ago
Other Give help by making test cases!
Hello friends! I just saw this excellent example (see some of the comments on that post) of a great way to give help and answer questions here when people are stuck: come up with simple test cases that demonstrate where the bug is! That way, the person who is stuck still gets a chance to figure out their problem and learn by doing. I know many of you are already great about this, but I figured it would be worth calling out. Happy puzzling! <3
r/adventofcode • u/naclmolecule • 14h ago
Visualization [2026 Day 1 (Part 1 & 2)] [Python] Terminal Visualization
I was too tired to post last night, still adjusting to late night solving... (ᴗ˳ᴗ)💤. Figured I'd help the elves by installing a crane in that dusty ol' shed. As always, code lives here: https://github.com/salt-die/Advent-of-Code/tree/main/2026/aoc_visuals.
r/adventofcode • u/subspace_mp4 • 1h ago
Meme/Funny [2026 Day 2 (Part 2)] It looked scary for a little while
r/adventofcode • u/apersonhithere • 3h ago
Visualization [2026 day 2] [python] quick & simple terminal visualization
the robot being represented with a face is because of dwarf fortress
r/adventofcode • u/Both-Touch990 • 3h ago
Meme/Funny [2026 Day 2 Part 2] How it felt getting the star only to realize there's a more efficient way to get the solution
(redo of an earlier post)
r/adventofcode • u/flwyd • 2h ago
Meme/Funny [2026 day 2] Looking for my favorite color in the input
r/adventofcode • u/p88h • 2h ago
Visualization [2026 Day 2] Color Weave
youtu.beSimulation on original (part1) and sort-rearranged program (part2)
Nim + raylib source
r/adventofcode • u/PhysPhD • 1h ago
Visualization [2026 Day 02] Rainbow Road Visualisation
r/adventofcode • u/Benj_FR • 2h ago
Meme/Funny [2026 day 2] I expected something else for part 2
This is by no means meant to criticize Eric Wastl who still does a great job by the way, I just found it funny
r/adventofcode • u/matth_l • 10h 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/Cloudan29 • 5h 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/naclmolecule • 55m ago
Visualization [2026 Day 2 (Part 1 & 2)] [Python] Terminal Visualization
Little calculator for path distances in the terminal. Can input whatever path one desires! The 2nd part is nearly closed-form, but depends on waypoints that may be missing from input. (Red + strike-through waypoints don't exist in input and should be considered non-existent in the 2nd part as well. "distance" is part 1 path distance and "len" is string length). As always, code lives here: https://github.com/salt-die/Advent-of-Code/tree/main/2026/aoc_visuals
r/adventofcode • u/Vraliance • 1h ago
Upping the Ante [2026 Day 1 (Part 1 & 2)] [Sabre] Advent of Code in My Programming Language
blog.rroessler.ioOver the past year I've been planning to do Advent of Code 2026 in Sabre, my own programming language. In doing so I am aiming to do a short article for each challenge, along with any bugs and library changes that I needed to implement whilst adventuring for solutions. So far 2026-12-01 went extremely well, though it did show me that I will need to think outside the box and implement some missing features that I may need for upcoming days. Hopefully I can keep on top of posting in between life, and excited for others to see the journey!
- Sabre Repository: https://github.com/sabre-lang/sabre
- Advent of Code Repository: https://github.com/sabre-lang/advent
Note: Both Sabre and my Advent of Code solutions do not use AI and will never use agentic help. I'm very much looking forward to showcasing and battle testing Sabre this year!
r/adventofcode • u/Boojum • 1h ago