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]]