Watch
1
0
Fork
You've already forked advent-of-code
0

2025 Day 6 Part 2

This commit is contained in:
Jeremy Kaplan 2025-12-15 18:08:46 -05:00
commit 72ea0da3c3

View file

@ -1,15 +1,40 @@
~ "aoc.ua" ~ Lines Words
Lines &fras "input/day06.txt"
⍚Words
⍜↘₋₁ ⍚◇⋕
≡°□
↻0_¯1
≡(
⍣(⍩(/×) °(⊂□"*")
| ⍩(/+) °(⊂□"+")
Input ← &fras "input/day06.txt"
Part₁ ← (
Lines
⍚Words
⍜↘₋₁ ⍚◇⋕
≡°□
↻0_¯1
≡(
⍣(⍩(/×) °(⊂□"*")
| ⍩(/+) °(⊂□"+")
)
°□
)
°□
/+
)
/+
Part₂ ← (
Lines
⬚@\s≡°□
⊜□ ¬⊸≡(⧻ regex "^\\s+$")
≡◇(
⟜≡(⋕ ⊡ 0_0 regex "\\d+" ↘¯1)
≡⊣
⊡ 0_0 regex "\\*|\\+"
⍣(⍩(/×) °(□"*")
| ⍩(/+) °(□"+")
)
)
/+
)
Part₁ Input
Part₂ Input