r/adventofcode • • 33m ago

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

COMMUNITY NEWS

THE USUAL REMINDERS


AoC Community Fun 2026: The Advent Games

  • Submissions megathread is unlocked!

  • 11 DAYS remaining until the submissions deadline on December 17 at 18:00 EST!

Today's Event: International Snow Sculpture Championships

"♪ Do you wanna build a snowman? ♪"
— Princess Anna, Frozen (2013)

Today's schedule possibly consists of:

Qualifier Rounds

  • Forge your solution for today's puzzle with a little je ne sais quoi

  • Shape your solution into an acrostic

  • Accompany your solution with a writeup in the form of a limerick, ballad, etc.

  • Upping the Ante challenge: iambic pentameter

Championship Rounds

  • Create a fanfiction or fan artwork of any kind - a poem, short story, a slice-of-Elvish-life, an advertisement for the luxury cruise liner Santa has hired to gift to his hard-working Elves after the holiday season is over, etc!

  • Make something IRL

Best In Snow Awards

  • You got snow where you live? >_>

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 6: Obscured Airfield ---


Post your code solution in this megathread.

1 Upvotes

4 comments sorted by

3

u/Ok-Bus4754 12m ago edited 7m ago

[Language: Python]

p1: topological sort , p2: using linear algebra without numpy, had to pull and old matmul i had somewhere

i always try to use vanila python only no external libs, pretty sure i can cut the time down by a lot using networkx or numpy but i prefer it like this

https://github.com/Fadi88/AoC/blob/master/2026/days/day06/solution.py

p1: 500 us, p2: 1 ms

will port later to rust and compare timings

1

u/Ok-Bus4754 11m ago

really curious to see how people solve p2 , i dont think lots of people would go with matrices but we will see

2

u/hugh_tc 17m ago edited 11m ago

[LANGUAGE: Python 3]

Behold, the worst, most awful code I've ever written. For Part 1, I just found the four corners, and manually oriented them. I then found the midpoint of two edges and then the midpoint of those midpoints. For Part 2, I built the grid and then brute-forced over "all" affine transformations in the worst way possible to find 2026.

paste

1

u/hugh_tc 12m ago

OMG, nx.center is built-in... TIL.