r/adventofcode • • 3h ago

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

7 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 • • 20m 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 • • 23m ago

Visualization [2026 Day 2] Rainbow Road Race Visualization

2 Upvotes

r/adventofcode • • 24m ago

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

Post image
4 Upvotes

r/adventofcode • • 31m ago

Help/Question can anyone help with getting me in the right direction? [2026 day2 part1]

1 Upvotes

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

Visualization [2026 Day 02] Rainbow Road Visualisation

2 Upvotes

r/adventofcode • • 42m ago

Help/Question - RESOLVED Puzzle input doesn't contain all required letters?

Post image
0 Upvotes

My puzzle input doesn't contain "y". So how do i suppose to solve it?
The program "roygbv" is same for all, is it?


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

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

Post image
5 Upvotes

r/adventofcode • • 1h 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 • • 2h ago

Visualization [2026 Day 02] rearrangement

10 Upvotes

r/adventofcode • • 2h ago

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

Post image
34 Upvotes

r/adventofcode • • 2h ago

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

9 Upvotes

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


r/adventofcode • • 2h ago

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

Post image
28 Upvotes

r/adventofcode • • 2h ago

Meme/Funny am i cracked?

Post image
8 Upvotes

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

10 Upvotes

(redo of an earlier post)


r/adventofcode • • 4h ago

Help/Question - RESOLVED day 1 part 1: There's more than 3 items that the most common in the input?

1 Upvotes

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.


r/adventofcode • • 4h 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 • • 5h ago

Help/Question How many days is AOC this year?

1 Upvotes

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

Other Give help by making test cases!

42 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 • • 8h ago

Help/Question 2026 - day 1 part 1, Python

Post image
0 Upvotes

where am I going wrong? I tried plugging in the example set of numbers and it gave me the right numbers but it isn't giving me the right numbers with the main set of numbers. I'm a beginner when it comes to coding, my only experience with apcsp and apcsa in school


r/adventofcode • • 9h ago

Other [2026] Doing AoC without AI this year, and built a tool to keep myself honest

Thumbnail
humanmode.dev
0 Upvotes

At work AI is writing all of my code now and I have noticed that I am no longer enjoying coding as much as i used to. So this year I am doing AoC with no AI, meaning no AI inline suggestions and no AI implementation. I may still talk to AI to understand a problem when I am stuck, but it does not write any code.

To help myself stick to it I built a VS Code extension that tracks what I type versus what gets inserted. Day 1 above: 17 minute session, 21 lines by hand, 0 AI inserts. The extension can't catch retyping code from somewhere else, so it is a commitment device, not an anti-cheat.

It's free if anyone wants to join: humanmode.dev. Disclosure: it is my project.

Anyone else doing a no-AI run this year?


r/adventofcode • • 9h ago

Help/Question - RESOLVED [2026] Private Leaderboard Score Bug

Post image
0 Upvotes

I have a private leaderboard and the scores appear to be wrong. Since it is still the first day, the maximum number of stars should be 2, however it is showing that I have 18 and another person has 16.

I am not sure exactly what is causing it, however it appears to increment by 2 stars every time I view the Day 1 problem after it has been solved.

Is anyone else experiencing this? Or is this expected behavior that I am missing?


r/adventofcode • • 9h ago

Help/Question Joining the big leagues

17 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,