|
|
|
@ -54,16 +54,40 @@ PartI ← (
|
|
|
|
|
):
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Prune ← ▽≡(≠0⊢⇌).
|
|
|
|
|
PartII ← (
|
|
|
|
|
↘6⊔⊃⊢(↘1)⊜□≠@\n.
|
|
|
|
|
⊓(
|
|
|
|
|
↯¯1_2⊜parse≠@ .
|
|
|
|
|
| ∧(
|
|
|
|
|
>@9⊢.⊔
|
|
|
|
|
(⍜(⊔⊢⇌|(⊂|¤;)type.):⊜parse≠@ .|⊂⊙i;)
|
|
|
|
|
(
|
|
|
|
|
⊜parse≠@ .
|
|
|
|
|
⍜⍘[⊙⊙∘]⊃(⋅∘|⋅⋅∘|-:)
|
|
|
|
|
⍜(⊔⊢⇌|(⊂|¤;)type.):
|
|
|
|
|
| ⊂⊙i;
|
|
|
|
|
)
|
|
|
|
|
)⊙{}
|
|
|
|
|
)
|
|
|
|
|
:
|
|
|
|
|
∧(
|
|
|
|
|
⊙⊙[]⊔
|
|
|
|
|
∧(
|
|
|
|
|
⊙⊙[]
|
|
|
|
|
∧(
|
|
|
|
|
⊙(↙2.)
|
|
|
|
|
≡\-◫2[⊃(∘|↧↥⊙:⊙⊙∘|↥⊙↧⊙⊙⋅∘|⋅∘)]∩⍘⊟∩\+
|
|
|
|
|
⊃(⋅∘|Prune⊂⊏0_2⊙⋅∘|Prune⊂¤⍜⊢+⊡1⊙(⊡2)⊙⊙⋅∘)
|
|
|
|
|
):
|
|
|
|
|
;
|
|
|
|
|
)
|
|
|
|
|
⊏⍏≡⊢.⊂
|
|
|
|
|
∧((⊂|⍜(⊡0_1)+:⊡1)=⊃(⊢|/+⊢⋅∘|⊙∘))⊃(↘1|¤⊢)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/↧ PartI TestInput
|
|
|
|
|
PartII TestInput
|
|
|
|
|
/↧≡⊢ PartII TestInput
|
|
|
|
|
|
|
|
|
|
/↧ PartI &fras "day05.in"
|
|
|
|
|
/↧≡⊢ PartII &fras "day05.in"
|
|
|
|
|