Unable to load image

rDrama Advent of Code Day 7: 25% Edition

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)

38
Jump in the discussion.

No email address required.

There's an extremely neat solution some APL gigachad will come up with, but that gigachad is not me.

o←(,5)(4 1)(3 2)(3 1 1)(2 2 1)(2 1 1 1)(1 1 1 1 1)
p1←'AKQJT98765432' ⋄ p2←'AKQT98765432J'
r←⊃⎕NGET'7.in'1 ⋄ bi←⍎¨6↓¨r ⋄ ci←5↑¨r ⋄ so←⊂∘⍋⌷⊢ ⋄ sr←⊂∘⍒⌷⊢

c←ci⌷⍨⊂⍋t←o⍳sr¨{≢⍵}⌸¨ci ⋄ u←c⊆⍨so t
⎕←+/(⍳∘≢×⊢)bi⌷⍨⊂ci⍳⌽⊃,/u{⍺⌷⍨⊂⍵}¨⍋¨p1∘⍳¨¨u

mcc←{2⊃1⌷sr{(≢⍵),⍺}⌸((⊂∘⍋p1∘⍳)⌷⊢)'J'~⍨⍵}
cj←{(,'J')≡∪⍵:5\'A' ⋄ (mcc ⍵)@(=∘'J')⊢⍵}¨ci
c←ci⌷⍨⊂⍋t←o⍳sr¨{≢⍵}⌸¨cj ⋄ u←c⊆⍨so t
⎕←+/(⍳∘≢×⊢)bi⌷⍨⊂ci⍳⌽⊃,/u{⍺⌷⍨⊂⍵}¨⍋¨p2∘⍳¨¨u

Brehs I think I have the neat solution but there's this dumb event I have to go to. Sitting on the train and all I can think about is APL encodings. Gonna be a long evening.

Jump in the discussion.

No email address required.

I don't know how you can internalise these magic runes and go on to ever think about anything other than APL encodings

Jump in the discussion.

No email address required.

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