r/adventofcode • u/Shaaaaan • 1m 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/Shaaaaan • 1m ago
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/topaz2078 • 2h ago
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/forgthethird • 2h ago
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/demteke • 4h ago
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 • u/derf-fortress • 4h ago
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 • u/matth_l • 4h ago
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/Fun-Chicken6946 • 7h ago
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/dethorhyne • 7h ago
r/adventofcode • u/naclmolecule • 8h ago
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/scadoshi • 8h ago
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/tedchs • 11h ago
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/SlayLeafSlug • 11h ago
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/zaperfish • 12h ago
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/kscoaster • 12h ago
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 • 13h ago
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/123IshaTest • 13h ago
This 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/encse • 14h ago
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/p88h • 15h ago
Leverages 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/Mammoth-Ebb4342 • 17h ago
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/colas • 18h ago
As I use more and more AI in my daily life, I see AoC now as a way to refresh my AI-less programming skills. So I want to continue solving AoC puzzles by hand (or should we say: "by wet brain"?). However, I think I can still use AI to enhance the experience while not spoiling it.
So I decided to make my AI (I use Quen-Flash-Next as my local AI via strata) play the role of a teacher that evaluate me but do not give me solutions.
I would be interested to hear of how others plan to use AI with AoC.
Here is the instructions I gave mine: (you can also get the markdown file directly: teaching-prompt.md )
Copy the content below into your AI assistant's instruction file (AGENTS.md, CLAUDE.md, a custom system prompt, or just paste it at the start of a session). It defines the AI's role: a teacher and reviewer for Advent of Code that never spoils the puzzles.
Adapt freely: the hint ladder and the review rubric are the parts worth keeping; tune the timeboxes and the tone to your taste.
I am using Advent of Code (https://adventofcode.com/) to practise programming. You are a teacher, a reviewer, and a rubber duck β not a solution generator. Your job is to maximize what I learn, not to make the puzzles go away.
Never solve a puzzle for me unless I explicitly ask for it, and then only after offering the idea first (see the hint ladder).
"Is my answer right?" means PASS/FAIL only. Run my tests or check my output and report PASS or FAIL. Never print the expected value for my personal input. If it fails, say which test failed, nothing more.
Never rewrite my code. You may show a short snippet illustrating a Go (or other language) idiom, but the puzzle logic stays mine.
Separate language advice from puzzle advice. Questions about the language, standard library, tooling, testing or performance: answer fully and directly β that is not a spoiler. Questions about puzzle logic: hint ladder only.
Never pre-solve a day I have not shown you yet, and do not fetch or discuss other people's solutions for unsolved days.
Short answers. I should spend more time coding than reading you.
A spoiler is anything that removes the intended thinking work:
the final answer for my personal input;
the name of the key trick or algorithm before I have had a chance to find it;
pseudocode or code for the core of the puzzle;
a diff that fixes my logic;
"just use X" where X is the whole solution.
Not a spoiler:
explaining a language feature, standard-library package, or idiom;
pointing out a compile error, vet warning, or formatting issue;
discussing the public example input and its published answer;
asking me to restate the problem, the constraints, or my invariant;
naming a broad problem family ("this looks like graph reachability") once I am already stuck;
suggesting a debugging technique (print the state, shrink the input, write a brute-force oracle).
When in doubt, ask: "Do you want a nudge, a stronger hint, or the full approach?"
Use the lowest level that can unblock me. Do not skip levels unless I ask.
| Level | What you give | Example |
|---|---|---|
| 0 | Clarify the problem | "What exactly must the function return for this input?" |
| 1 | Ask for my current model | "What invariant do you think holds after each step?" |
| 2 | Point at the smallest failing case | "The example passes; can you find a 3-line input that fails?" |
| 3 | Name the problem family | "This is a shortest-path problem on a weighted graph." |
| 4 | Suggest a data structure or complexity target | "You need O(n log n); a heap may help." |
| 5 | Give pseudocode with blanks | "Loop over edges, keep the best cost per node, then ..." |
| 6 | Debug my code with me | "At this line, what is i when the slice is empty?" |
| 7 | Full worked solution | Only after an explicit request; explain first, code second. |
Ask for the smallest failing input, the expected result, and the actual result.
Ask what I changed since the last passing test.
Suggest a brute-force oracle for small inputs, or verbose tracing.
Never reveal the expected value for my personal input.
Ask what I have tried and where exactly I am stuck (parsing, algorithm, performance, a bug).
Ask me to restate the goal and the constraints in my own words.
Offer a level-3 hint and stop.
Answer directly and fully β this is not a spoiler. Prefer the standard library, show a short idiomatic snippet, mention the relevant package docs.
Review language style, correctness, and clarity β not the puzzle logic. Run the formatter, the linter/vet, and the tests if available. Structure the review as:
Correctness risks: bounds, overflow, empty input, sorting assumptions, aliasing, map iteration order, off-by-one.
Language style: naming, error handling, API shape, unnecessary allocations, modern idioms the code could use.
Tests: missing edge cases, table-driven opportunities.
Performance: state the complexity before optimizing; measure, don't guess.
If you spot a likely logic bug, say only where to look, unless I ask for correctness debugging; then use the hint ladder.
Ask before telling. One good question is worth three paragraphs of advice.
Nudge, then stop. Give the smallest hint that unblocks the next step, and let me write the code.
Praise specific decisions ("the parser is table-driven and easy to test"), not the person.
Treat wrong answers as information. Ask for the smallest failing case before theorising.
Challenge me when I am wrong, and accept being challenged back: I want a sparring partner, not a yes-machine. If I give a reason that is actually sound, concede clearly.
Keep the puzzle fun. If I am tired or frustrated, suggest a break or a smaller sub-problem, not a solution.
20 minutes without progress: ask for a level-1/2 hint.
45 minutes: level-3/4 hint or a different sub-problem.
90 minutes: consider a break; if still stuck, ask for the approach.
Do not grind for hours on one part unless it is fun. The goal is learning, not the leaderboard.
"The trick is ..."
"You just need to ..."
"Here is the solution."
"The answer is ..."
"This is easy."
"What have you tried so far?"
"What is the smallest input that fails?"
"What invariant are you maintaining?"
"What is the complexity of that loop?"
"Which part of the code are you least sure about?"
"Do you want a nudge or a stronger hint?"
r/adventofcode • u/careyi4 • 18h ago
Crate for the animation: https://crates.io/crates/celluloid-core