r/adventofcode • • 4h ago

SOLUTION MEGATHREAD -❄️- 2026 Day 2 Solutions -❄️-

8 Upvotes

THE USUAL REMINDERS


AoC Community Fun 2026: The Advent Games

Today's Event: International Toboggan Championships

"Feel the rhythm, feel the rhyme, get on up, it's bobsled toboggan 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.


r/adventofcode • • 1d ago

Upping the Ante -❄️- Advent of Code 2026: The Advent Games -❄️- Submissions Megathread -❄️-

14 Upvotes

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 DecTime (EST)Action
0100:00Opening Ceremonies (community fun announced)
0300:00ishSubmissions megathread unlocked
1200:00Closing Ceremonies (AoC 2026 event ends)
1718:00SUBMISSIONS DEADLINE
17ASAPSubmissions megathread locked and voting opens (will post and sticky a PSA with link to vote)
2018:00Voting closes
20ASAPVictory 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 WinnersWho Votes
Bronze Medalist10†the AoC community (you!)
Silver Medalist3†/r/adventofcode moderators + /u/topaz2078
Gold Medalist1highest combined point total

† Amounts subject to change based on availability and/or tie-breaking.

How Judging Works

  1. When voting opens, vote for your favorite exhibition piece(s). Your individual vote is worth 1 point each.
  2. When voting closes, the 10 highest-voted entries are declared Bronze Medalists.
  3. Of the 10 Bronze Medalists, each of the /r/adventofcode moderators will pick their top 3 to be awarded as a Silver Medalist.
  1. All point totals are aggregated (community vote + mod vote). The highest combined point total will be officially declared as the Gold Medalist of 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 the Gold Medalist awards 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 • • 3h ago

Meme/Funny [2026 Day 02] I see a pattern...

Post image
40 Upvotes

r/adventofcode • • 3h ago

Meme/Funny [2026 Day 02] Richard of York gave battle vain

Post image
35 Upvotes

r/adventofcode • • 13h ago

Meme/Funny Every year it always starts the same before it goes bonkers

Post image
213 Upvotes

r/adventofcode • • 8h ago

Other Give help by making test cases!

46 Upvotes

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 • • 14h ago

Visualization [2026 Day 1 (Part 1 & 2)] [Python] Terminal Visualization

Post image
121 Upvotes

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 • • 3h ago

Visualization [2026 Day 02] rearrangement

Post image
12 Upvotes

r/adventofcode • • 1h ago

Meme/Funny [2026 Day 2 (Part 2)] It looked scary for a little while

Post image
7 Upvotes

r/adventofcode • • 3h ago

Visualization [2026 day 2] [python] quick & simple terminal visualization

Post image
10 Upvotes

the robot being represented with a face is because of dwarf fortress


r/adventofcode • • 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

Post image
10 Upvotes

(redo of an earlier post)


r/adventofcode • • 3h ago

Meme/Funny am i cracked?

Post image
8 Upvotes

r/adventofcode • • 1d ago

Meme/Funny [2026 Day 1] Claim yours here!

Post image
407 Upvotes

r/adventofcode • • 2h ago

Meme/Funny [2026 day 2] Looking for my favorite color in the input

Post image
6 Upvotes

r/adventofcode • • 2h ago

Visualization [2026 Day 2] Color Weave

Thumbnail youtu.be
6 Upvotes

Simulation on original (part1) and sort-rearranged program (part2)

Nim + raylib source


r/adventofcode • • 1h ago

Visualization [2026 Day 02] Rainbow Road Visualisation

Post image
5 Upvotes

r/adventofcode • • 2h ago

Meme/Funny [2026 day 2] I expected something else for part 2

Post image
4 Upvotes

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 • • 10h ago

Help/Question Joining the big leagues

18 Upvotes

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 • • 14h ago

Visualization [2026 Day 01] 3d render

Post image
32 Upvotes

r/adventofcode • • 5h ago

Help/Question - RESOLVED Python Solution Gives correct solution for part 1 but not part 2

6 Upvotes

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 • • 55m ago

Visualization [2026 Day 2 (Part 1 & 2)] [Python] Terminal Visualization

Post image
2 Upvotes

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 • • 1h ago

Upping the Ante [2026 Day 1 (Part 1 & 2)] [Sabre] Advent of Code in My Programming Language

Thumbnail blog.rroessler.io
2 Upvotes

Over 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 • • 1h ago

Visualization [2026 Day 2] Rainbow Road Race Visualization

Post image
2 Upvotes

r/adventofcode • • 1d ago

Meme/Funny [2026 Day 1] Anyone else psych themselves out with the first day only to find...

Post image
245 Upvotes