Unable to load image

rDrama Advent of Code Day 11: Orbital Mechanics Edition

Summary for those just joining us:

Advent of Code is an annual Christmas themed coding challenge that runs from December 1st until christmas. Each day the coding problems get progressively harder. We have a leaderboard and pretty good turnout, so feel free to hop in at any time and show your stuff!

Whether you have a single line monstrosity or a beautiful phone book sized stack of OOP code, you can export it in a nice little image for sharing at https://carbon.vercel.app

What did you think about today's problem?

https://adventofcode.com/2023

Our Code is 2416137-393b284c (No need to share your profile, you have the option to join anonymously if you don't want us to see your github)

19
Jump in the discussion.

No email address required.

>spent most of my time using Kruskal's to find the shortest path before realising that's not what the question wanted at all

:#marseyclown3:

⎕PP←20
r←↑⊃⎕NGET'11.in'1
w←{1+∧/'.'=⍵}
d←{+/∊(⊢×(∘.<⍨∘⍳)∘≢)(∘.{+/|⍺-⍵})⍨⍵}
⎕←d⍸'#'=⍉(w⊢⍤/⍉)(w∘⍉⊢⍤/⊢)r

M←¯1+1000000 ⋄ g←⍸'#'=r
a←{+\∧/'.'=⍵} ⋄ z←{⍵+M×⍺⌷⍨⊂⍵}
x←(a⍉r) z 2⊃¨g ⋄ y←(a r) z 1⊃¨g
⎕←d y,¨x
Jump in the discussion.

No email address required.

He knew what he was doing using those words, I was halfway through a distance matrix when it clicked for me.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.