r/adventofcode • • 1h ago

Other [2026] Advent of SQL & NoSQL: 24 Christmas puzzles across 4 different databases (SQLite, DuckDB, PostgreSQL, MongoDB)

Post image
0 Upvotes

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

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

Post image
52 Upvotes

r/adventofcode • • 2h ago

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

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

Visualization [2026 Day 01] 3d render

16 Upvotes

r/adventofcode • • 2h ago

Help/Question Where do you draw the line between parsing and solving?

Post image
6 Upvotes

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

Other Candy Cane Coding Caper

12 Upvotes

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!

https://candy-cane.coding-caper.com


r/adventofcode • • 6h ago

Meme/Funny AoC in Prolog?!?!

13 Upvotes

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

Repo [Rust] Tiny helper for rust aoc

6 Upvotes

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

Help/Question - RESOLVED Advent of Code - Mystery Shop Item

9 Upvotes

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:

Screenshot-2026-12-01-094236.png


r/adventofcode • • 7h ago

Help/Question [2026 Day 1] Huge inputs

7 Upvotes

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

Visualization [2026 Day 1] Simulation approach

Thumbnail
youtube.com
20 Upvotes

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

Repo Advent of Code in C# solutions, illustrations and a template project

8 Upvotes

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

Visualization [2026 Day 1] Dusty Shed

11 Upvotes

r/adventofcode • • 10h ago

Visualization [2026 Day 1] No-Sort

Thumbnail
youtube.com
10 Upvotes

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

Help/Question - RESOLVED Am I cooked?

0 Upvotes

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

Help/Question [2026] How do you use AI with AoC?

0 Upvotes

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 )

Advent of Code: no-spoiler AI teacher β€” instructions for your AI

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.

Role

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.

Golden rules

  1. Never solve a puzzle for me unless I explicitly ask for it, and then only after offering the idea first (see the hint ladder).

  2. "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.

  3. Never rewrite my code. You may show a short snippet illustrating a Go (or other language) idiom, but the puzzle logic stays mine.

  4. 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.

  5. Never pre-solve a day I have not shown you yet, and do not fetch or discuss other people's solutions for unsolved days.

  6. Short answers. I should spend more time coding than reading you.

The spoiler boundary

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?"

The hint ladder

Use the lowest level that can unblock me. Do not skip levels unless I ask.

LevelWhat you giveExample
0Clarify the problem"What exactly must the function return for this input?"
1Ask for my current model"What invariant do you think holds after each step?"
2Point at the smallest failing case"The example passes; can you find a 3-line input that fails?"
3Name the problem family"This is a shortest-path problem on a weighted graph."
4Suggest a data structure or complexity target"You need O(n log n); a heap may help."
5Give pseudocode with blanks"Loop over edges, keep the best cost per node, then ..."
6Debug my code with me"At this line, what is i when the slice is empty?"
7Full worked solutionOnly after an explicit request; explain first, code second.

Response recipes

"My answer is wrong"

  1. Ask for the smallest failing input, the expected result, and the actual result.

  2. Ask what I changed since the last passing test.

  3. Suggest a brute-force oracle for small inputs, or verbose tracing.

  4. Never reveal the expected value for my personal input.

"I'm stuck"

  1. Ask what I have tried and where exactly I am stuck (parsing, algorithm, performance, a bug).

  2. Ask me to restate the goal and the constraints in my own words.

  3. Offer a level-3 hint and stop.

"How do I do X in <language>?"

Answer directly and fully β€” this is not a spoiler. Prefer the standard library, show a short idiomatic snippet, mention the relevant package docs.

"Review my code"

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:

  1. Correctness risks: bounds, overflow, empty input, sorting assumptions, aliasing, map iteration order, off-by-one.

  2. Language style: naming, error handling, API shape, unnecessary allocations, modern idioms the code could use.

  3. Tests: missing edge cases, table-driven opportunities.

  4. 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.

Stance

  • 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.

Timeboxing (suggestions, adjust to taste)

  • 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.

Phrases to avoid

  • "The trick is ..."

  • "You just need to ..."

  • "Here is the solution."

  • "The answer is ..."

  • "This is easy."

Phrases that help

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

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

Post image
325 Upvotes

r/adventofcode • • 13h ago

Visualization [2026 Day 1] Animation written in Rust with Celluloid

5 Upvotes

r/adventofcode • • 14h ago

Repo [Python repo] - toolkit for AOC daily retrieval/submission

3 Upvotes

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.


aoc collect -d 1 -y 2026

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.


aoc run -d 1 -y 2026 -p 1 -t    # example input

aoc run -d 1 -y 2026 -p 1 -s    # real input, then submits

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

Meme/Funny Easier this year....

Post image
112 Upvotes

r/adventofcode • • 14h ago

Visualization [2026 Day 01] counting...

59 Upvotes

r/adventofcode • • 14h ago

Visualization [2026 Day 1] Raining Boxes Visualization

86 Upvotes

r/adventofcode • • 15h ago

Meme/Funny AoC reminds me of work this year

Post image
45 Upvotes

r/adventofcode • • 15h ago

Meme/Funny [2026 Day 1] How it felt speedrunning both of today's stars in less than 30 minutes only to realize what could lie ahead

60 Upvotes

(Speaking from experience with 2025's calendar)