2025 Day 6 Part 2
This commit is contained in:
parent
7373cbfe8e
commit
72ea0da3c3
1 changed files with 36 additions and 11 deletions
|
|
@ -1,15 +1,40 @@
|
||||||
~ "aoc.ua" ~ Lines Words
|
~ "aoc.ua" ~ Lines Words
|
||||||
|
|
||||||
Lines &fras "input/day06.txt"
|
Input ← &fras "input/day06.txt"
|
||||||
⍚Words
|
|
||||||
⍜↘₋₁ ⍚◇⋕
|
Part₁ ← (
|
||||||
≡°□
|
Lines
|
||||||
⍉
|
⍚Words
|
||||||
↻0_¯1
|
⍜↘₋₁ ⍚◇⋕
|
||||||
≡(
|
≡°□
|
||||||
⍣(⍩(/×) °(⊂□"*")
|
|
||||||
| ⍩(/+) °(⊂□"+")
|
⍉
|
||||||
|
↻0_¯1
|
||||||
|
≡(
|
||||||
|
⍣(⍩(/×) °(⊂□"*")
|
||||||
|
| ⍩(/+) °(⊂□"+")
|
||||||
|
)
|
||||||
|
°□
|
||||||
)
|
)
|
||||||
°□
|
/+
|
||||||
)
|
)
|
||||||
/+
|
|
||||||
|
Part₂ ← (
|
||||||
|
Lines
|
||||||
|
⬚@\s≡°□
|
||||||
|
⍉
|
||||||
|
|
||||||
|
⊜□ ¬⊸≡(⧻ regex "^\\s+$")
|
||||||
|
≡◇(
|
||||||
|
⟜≡(⋕ ⊡ 0_0 regex "\\d+" ↘¯1)
|
||||||
|
≡⊣
|
||||||
|
⊡ 0_0 regex "\\*|\\+"
|
||||||
|
⍣(⍩(/×) °(□"*")
|
||||||
|
| ⍩(/+) °(□"+")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
/+
|
||||||
|
)
|
||||||
|
|
||||||
|
Part₁ Input
|
||||||
|
Part₂ Input
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue