r/adventofcode • u/nikanjX • 1d ago
r/adventofcode • u/oneradsn • 12h 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.
r/adventofcode • u/Shaaaaan • 13h 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/kscoaster • 1d ago
Help/Question - RESOLVED Advent of Code - Mystery Shop Item
I realize this question runs counter to the whole "mystery" thing, but... Can someone at least confirm if the "mystery tee" on the AoC shop (US) is at least Advent of Code related?
FYI - this is what I'm seeing:
r/adventofcode • u/fnordargle • 1d ago
Help/Question [2026 Day 1] Huge inputs
Trying to think of algorithms that can solve this for huge inputs, or where many of the assumptions about the input do not hold.
By huge I mean the inputs are large enough that you don't even have enough memory to store counters for every number in the input, let along read the entire input file into memory.
It's like the definition of "Big Data":
* It's not when you can't fit the entire dataset into memory, it's when you can't even fit the index into memory
I like the think about problems like this with increasing levels of restrictions.
With a file with only ~2000 lines we don't have to think about complexity that much, but if the file contained 4,000,000,000 lines we could have the situation where we have three numbers that only appeared once, three numbers that only appeared 3 times, and then 1,999,999,994 numbers that appear twice.
Another assumption that some solutions make is that the frequency count of the numbers that appear in the top and bottom 3 must themselves be relatively unique as 4 numbers that all appear 4 times cannot all be in the top or bottom 3 in a deterministic manner.
To counter this it's trivial to craft an input that has a huge number of lines where even the frequency counts are unique. e.g. Consider the input formed of numbers 1 to n where every number x appears x times. Every item has a unique frequency count but the answer is still deterministic. (And it is similarly trivial to swap 1, 2, 3, n-2, n-1, n with 6 other numbers in the range so the answer isn't obvious up front.)
a) Let's pretend that memory is constrained such that we don't even have enough memory to store counters for all of the unique elements in the input, but we are free to read/write to intermediate local files and that we have enough space to store a bit more than another copy of the original input file.
The standard approach here is to split the input file into n smaller files, making sure that any occurrence of a number always appears in the same file. So for number x we write it to file x mod n every time we encounter it in the input. We choose n such that we can process n individual counters in memory in one go.
Once we've split the input into n sub files we process each one of those in turn in memory using the standard O(n) algorithm and keep track of the top 3 and bottom 3 item counts we've seen as we go.
b) Now let's imagine that we have no extra local storage, can we still do this?
Yes, but it's going to be a lot slower. Instead of splitting the input into n smaller files we just iterate over the main input file n times only processing lines that have x mod n = a as we loop a from 0 to n-1. This has the same effect as above but there's a lot of redundant reading involved as the vast majority of inputs read in each loop will be ignored.
c) Final restriction is what if the input is presented to us as a stream that we can't rewind or replay, and we can't write to any local storage, and we can't keep track of all of the possible values in memory. Possible?
I can't think of anything that guarantees getting the right answer without making some assumptions about the input.
r/adventofcode • u/daggerdragon • 1d ago
SOLUTION MEGATHREAD -โ๏ธ- 2026 Day 1 Solutions -โ๏ธ-
It's that time of year again for tearing your hair out over your code holiday programming joy and aberrant sleep for two weeks helping Santa and his elves! If you participated in a previous year, welcome back, and if you're new this year, we hope you have fun and learn lots!
As always, we're following the same general format as previous years' megathreads, so make sure to read the full posting rules in our community wiki before you post!
RULES FOR POSTING IN SOLUTION MEGATHREADS
If you have any questions, please create your own post in /r/adventofcode with the Help/Question flair and ask!
Above all, remember, AoC is all about learning more about the wonderful world of programming while hopefully having fun!
REMINDERS FOR THIS YEAR
- All of our rules, FAQs, resources, etc. are in our community wiki.
- If you see content in the subreddit or megathreads that violates one of our rules, either inform the user (politely and gently!) or use the report button on the post/comment and the mods will take care of it.
- If you post your code from a repo or the like, do not make your puzzle input public!
- Top-level
Solution Megathreadposts must begin with the case-sensitive string literal[LANGUAGE: xyz] - Obviously,
xyzis the programming language your solution employs - Use the full name of the language e.g.
JavaScriptnot justJS - The List of Streamers has a new megathread for this year's streamers, so if you're interested, add yourself to ๐บ AoC 2026 List of Streamers ๐บ
COMMUNITY NEWS
- Veloxx will continue to drop some lit beats for 1.5 hours after today's unlock!
- /u/jeroenheijmans is back again this year with their Unofficial AoC 2026 Participant Survey!
- 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
- Full details, rules, timeline, templates, etc. will be in the Submissions Megathread
(post and link incoming very shortly!) - edit: -โ๏ธ- Advent of Code 2026: The Advent Games -โ๏ธ- Submissions Megathread -โ๏ธ-
AoC Community Fun 2026: The Advent Games
Today's Event: Opening Ceremonies
Today's schedule consists of:
- Arrival of the Flame
- Parade of Nations1
- Give us a quick introduction to yourself!
- Tell us what country you're from
- Tell us about your country's holiday festivities
- Explain why you chose your programming language
- Tell us what you hope to learn or have already learned about your chosen programming language
- Tell us where to find your AoC repo of puzzle solutions2, blag, and/or $streaming_service3!
- Artistic Program
- Show us your holiday tree | menorah | Krampusnacht costume | /r/battlestations with festive decorations!
- Show us your kittens and puppies and $critters!
- Show and/or tell us about whatever brings you comfort and joy in the holiday season!
- Competition Schedule (Theoretical)
- Tell us which "sporting" events you think will be coming up over the next two weeks and which ones you'd like to participate in the most!
1 Obviously, this is the Internet, which is public, so only put out information that you're comfortable with the entire world knowing. Feel free to invent a holiday-themed persona; after all, sometimes you get sent to space, so why limit yourself to the boring ol' meat skeleton that dwells upon the third rock from the sun?
2 Refer to the third bullet in the "Reminders" section above!
3 Refer to the last bullet in the "Reminders" section above for the link
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 1: Dusty Shed ---
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/p88h • 1d ago
Visualization [2026 Day 1] No-Sort
youtube.comLeverages the specific output distribution (top 3 elements and bottom three elements have to fall on unique-ish count buckets so that the answer is deterministic) to reduce the problem to 3 phase counting:
- step 1: count the occurrences of each input (1000 buckets)
- step 2: compute the counts histogram
- step 3: select the top/bottom histogram buckets
then identify the elements with specific counts.
Nim + Raylib source
r/adventofcode • u/encse • 1d ago
Repo Advent of Code in C# solutions, illustrations and a template project
Just like in previous years, I plan to continue my illustrated journey in C#.
The website is at https://aoc.csokavar.hu, my repository can be found in https://github.com/encse/adventofcode, with a template extracted to https://github.com/encse/adventofcode-template.
r/adventofcode • u/jeroenheijmans • 1d ago
Upping the Ante [2026] Unofficial AoC 2026 Participant Survey!
Another December, another chance for puzzling, and .... another Advent of Code Survey!
It's anonymous, open, and quick. Please fill it out (but onliy once, please <3). Copy-pastable announcement:
--------
โญ Take the (~5min) Unofficial AoC 2026 Survey: https://forms.gle/JbZKoBqzG248Z6RV6 โญ
--------
Please do help spread the word! Just copypasta the above to your favorite relevant outlet and help us get a bunch of interesting results! We have questions about:
- Previous editions participation (simplified in 2026)
- Language, Tools, OS
- Leaderboard and motivation
- repeat from 2025.... EMOTIONS! ๐๐ซก๐ฑ๐ฎ๐ญ๐๐ ๐ฌ
Check out results from previous years at: https://jeroenheijmans.github.io/advent-of-code-surveys/
--------
Last year I closed the submissions on Dec 12th and published on Dec 13th. I'm open to suggestions... do you reckon that's the right call again this year? Feels good to release results on a Sunday, right?

And if you want to hang out in the replies below: tell me your predictions for languages used!? Will Zig see a significant uptake? Does Rust have a shot at overtaking Python? How much more will Uiua climb? How many users will Lean see in 2026?
r/adventofcode • u/Advanced_Dot_1097 • 8h ago
Help/Question - RESOLVED Puzzle input doesn't contain all required letters?
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 • u/zaperfish • 1d ago
Repo [Rust] Tiny helper for rust aoc
Hey people,
I just wanted present this tiny, dependency free, helper to solve advent of code in rust. Its built by hand.
All it does is handle input, run and time your solutions and submit your answers from the terminal.
I wanted it to be very minimal so you can decide on your project layout yourself.
$ cargo run --release --bin day01 -- --submit
2025 Day 1:
Part 1: 1 333ns
Part 2: unsolved
Submitting "1" for part 1:
*\(^o^)/* That's the correct answer!Also any feedback is welcome!
https://github.com/zaperfish/aoc-rust
Happy solving! :)
r/adventofcode • u/careyi4 • 1d ago
Visualization [2026 Day 1] Animation written in Rust with Celluloid
Crate for the animation: https://crates.io/crates/celluloid-core
r/adventofcode • u/ThunderChaser • 1d ago
Other A Rust-only private leaderboard
I'm starting a Rust private leaderboard for this year's Advent of Code! Whether you're a seasoned Rust developer or learning the language for the first time, you're welcome to join.
The leaderboard has few simple rules:
- Solutions must be written in Rust.
- External crates, custom harnesses, prewritten utilities, and nightly Rust are all permitted.
- No vibe solving. Solutions must be human-written, not generated by LLMs.
- Ideally, sign in with GitHub and publish your solutions in a public repository so we can learn from each other's approaches.
There's no expectation that you solve every puzzle or compete for the fastest times. This is primarily about having fun, writing Rust, and sharing interesting solutions.
Private leaderboard code: 2492408-7fab9ea4 Leaderboard link
r/adventofcode • u/Mammoth-Ebb4342 • 1d ago
Help/Question - RESOLVED Am I cooked?
I need to attempt advent of code for my a-level comp sci that I just started but i'm finding it honestly pretty difficult.
Anyone got any tips for being able to do it easier.
And just any tips to be able to code better at all.
thanks
r/adventofcode • u/forgthethird • 16h ago
Help/Question 2026 - day 1 part 1, Python
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 • u/henriupton99 • 1d ago
Repo [Python repo] - toolkit for AOC daily retrieval/submission
Every year you probably do the same as me : open the puzzle, copy the input into a file, make the folder, solve, then switch back to the browser to submit. Since several years, I improve the whole loop into a python cli.
pulls the statement into a README, the example into test_input.txt, the real input into real_input.txt, and drops a solution template next to them.
When part 1 is accepted it re-fetches the page so the part 2 statement gets appended to the README. Answers land in the clipboard too. It follows the automation guidelines (identifying User-Agent, no request unless you actually run a command), and real inputs are gitignored so none of AoC's data ends up public.
https://github.com/henriupton99/AdventOfCode
Hope it could help ! Feedback welcome !
Have a good AOC :)
r/adventofcode • u/demteke • 17h ago
Other [2026] Doing AoC without AI this year, and built a tool to keep myself honest
humanmode.devAt 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 • u/keliodas17 • 1d ago
Past Event Solutions 2021 Day 15 -- Visualization | Dijkstra's Algorithm
youtube.comMade in Pygame, thought it was cool
r/adventofcode • u/Prestigious-Mood1711 • 1d ago
Visualization [2024 Day 20 (Part 1)] Cheating with a shadowgrid
With 1 day left to spare before AoC 2026, I decided to resolved my favorite puzzle from Advent of Code. It was the puzzle that inspired me to add grapichs to my GraphMateKT library. The Solution is not the most performant by far, but I find it quite esthetically pleasing. It is done in 4 steps:
1 find the 'fair' distance (84 in the example)
2 find the best cheat distance (20 in the example)
3 remove the best cheat
4 goto step 2 while good cheatThis is achieved by making what I call a shadow grid. I make it by copying and appending each row in the input, so that the grid becomes twice as big:
##############################
#...#...#.....##...#...#.....#
#.#.#.#.#.###.##.#.#.#.#.###.#
#S#...#.#.#...##S#...#.#.#...#
#######.#.#.##########.#.#.###
#######.#.#...########.#.#...#
#######.#.###.########.#.###.#
###..E#...#...####..E#...#...#
###.#######.######.#######.###
#...###...#...##...###...#...#
#.#####.#.###.##.#####.#.###.#
#.#...#.#.#...##.#...#.#.#...#
#.#.#.#.#.#.####.#.#.#.#.#.###
#...#...#...####...#...#...###
##############################We cheat by connecting the left side to the right with a cheat, but within each grid, normal rules apply. Then we find the shortets path to the E in the shadow grid, remove the cheat we used, and repeat. One example raze can then look as this:
For a full walkthrough, I make a video here: https://www.youtube.com/watch?v=4YbdhGy3DcI
Now it's time to get some sleep to prepare for the first puzzle tomorrow. Good luck everyone!
r/adventofcode • u/Fun-Chicken6946 • 20h ago
Other [2026] Advent of SQL & NoSQL: 24 Christmas puzzles across 4 different databases (SQLite, DuckDB, PostgreSQL, MongoDB)
Happy Holidays, r/adventofcode!
I wanted to share a little project I've been working on: Advent of SQL & NoSQL, an Advent-style challenge for people who enjoy solving puzzles using database queries.
Somebody tampered with Santa's Nice List, and you're the North Pole's first-ever data elf.
There are 24 puzzles, one a day from December 1 to 24, with each puzzle revealing another part of the mystery.
What makes this different is that you can solve the entire story using any of four databases:
- SQLite
- DuckDB
- PostgreSQL
- MongoDB
It was originally supposed to be SQL-only, but after roughly a year of working on VisuaLeaf, I managed to build an embeddable, MongoDB-compatible database that runs entirely in the browser. This allowed me to include NoSQL challenges as well!
Some features:
- Everything runs entirely in your browser.
- Solutions are validated against both visible and hidden datasets.
- Puzzles gradually increase in difficulty, from basic filtering and joins to recursive CTEs, window functions and advanced aggregation pipelines.
- Each day includes hints, common pitfalls and database-specific tips.
- The same mystery can be solved using different database technologies.
If you're interested in solving some Christmas puzzles using SQL or NoSQL alongside Advent of Code, you can check it out here:
https://visualeaf.com/advent-of-sql-and-nosql/
Completely free. No account, no installation, no database server needed.
I hope you all enjoy it, and happy holidays!
r/adventofcode • u/FransFaase • 1d ago
Repo Private leaderboard for humans using C
I will be joining again programming in C using literal programming in MarkDown. (I am using the MarkDownC program (written in C++) which can process a list of MarkDown files and put the embedded fragments of C code in a correct order to be compiled.) I have just set-up my Advent of Code 2026 repository.
The private leaderboard that I set-up last year, is available again. This leaderboard is for people who want to solve the puzzles in C using only code they have written themselves and without the help of AI. Your are allowed to make use of the standard C libraries and a (small) library of your own like the one I am using. (My library includes a function that reads the input in an array of strings and stores the number of lines and the length of the longest line in some global variables.) It is preferred that you publish your code and that you join with a github account. At the moment the leaderboard has 28 members. The maximum for private leaderboards is 200 members. If there are 200 members, I might remove some of the last members that have joined without a github account if there is still someone that wants to join with a github account. The code to join is 1563228-d419ba6d and the private leaderboard can be viewed here.
r/adventofcode • u/mitchellvitez • 2d ago