this post was submitted on 09 Nov 2025
9 points (84.6% liked)

Advent Of Code

1200 readers
1 users here now

An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Everybody Codes is another collection of programming puzzles with seasonal events.

EC 2025

AoC 2025

Solution Threads

M T W T F S S
1 2 3 4 5 6 7
8 9 10 11 12

Visualisations Megathread

Rules/Guidelines

Relevant Communities

Relevant Links

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

console.log('Hello World')

founded 2 years ago
MODERATORS
 

Quest 5: Fishbone Order

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

Link to participate: https://everybody.codes/

you are viewing a single comment's thread
view the rest of the comments
[–] mykl@lemmy.world 2 points 1 month ago* (last edited 1 month ago)

Uiua

[Works on test data, but fails on Part 3 live data: my checksum is "Correct length and correct first character". Posting for the record while I think about it more.] Turned out to be trailing zeros.

F ← (
  β†˜1βŠ™[0_0_0] # Create empty row
  ∧(
    ◑≑([βŠƒ(β†§βŠƒ(=0βŠ’β—Œ|>βŠ™βŠ‘β‚)|=0βŠ‘β‚β—Œ|β†§βŠƒ(=0βŠ£β—Œ|<βŠ™βŠ‘β‚))]) # Will it fit in each row?
    βŠŸβŠ™(⊒⊚)βŸœβŠ‘βŠ’βŠšβŠΈβ‰‘/β†₯                             # Find first non-zero row and col.
    (βœβŠ‘β‹…βˆ˜)βŠ™βŠƒβ‹…βˆ˜βˆ˜                                # insert
    β₯(ΛœβŠ‚0_0_0)¬≍0_0_0⊸⊣                        # Add padding row back
  )
  β†˜Β―1
)
S     ← β‹•/$"__"⊑1⍉
Part₁ ← S F
Partβ‚‚ ← -βŠƒ/↧/β†₯≑(S F)

Part₃ ← (
  ⬚0βŠΈβ‰‘(βŠ‚βŠƒ(S|≑(Β°βŠ₯β‚β‚€β–½βŠΈ>β‚€β‡Œ))F) # All sword stats
  β‰‘βŠ‚βŠ™(βŠ’β‰)             # Append sword IDs
  βŠβŠΈβ–                 # Sort
  /+Γ—+1Β°βŠβ‰‘βŠ£           # Checksum
)

Part₁ [58 5 3 7 8 9 10 4 5 7 8 8]
Partβ‚‚ [[2 7 9 9 3 8 3 8 8 6 8] [5 2 9 3 8 3 9 5 2 1 4]]
Part₃ [[1 7 1 9 1 6 9 8 3 7 2]
       [2 7 1 9 1 6 9 8 3 7 2]]