|
|
@ -10,10 +10,10 @@ TestInput ←
|
|
|
|
# Original parsing solution
|
|
|
|
# Original parsing solution
|
|
|
|
Colors ← {"red" "green" "blue"}
|
|
|
|
Colors ← {"red" "green" "blue"}
|
|
|
|
Parse ← (
|
|
|
|
Parse ← (
|
|
|
|
⊔⊢⇌↘1 regex "Game (\\d+): (.*)"
|
|
|
|
°□⊢⇌↘1 regex "Game (\\d+): (.*)"
|
|
|
|
⊜(□⊜(⇌⊜((parse⊔⋅∘|⊙;)<3.⊃(⊗⊙Colors|∘)□)≠@ .)≠@,.)≠@;.
|
|
|
|
⊜(□⊜(⇌⊜((⋕°□⋅∘|⊙;)<3.⊃(⊗⊙Colors|∘)□)≠@ .)≠@,.)≠@;.
|
|
|
|
≡(
|
|
|
|
≡(
|
|
|
|
∧(⍜⊡+⊙:⍘⊟)⊃⊔0_0_0
|
|
|
|
∧(⍜⊡+⊙:°⊟)⊃°□0_0_0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ Parse ← (
|
|
|
|
ColorsII ← "rgb"
|
|
|
|
ColorsII ← "rgb"
|
|
|
|
ParseII ← (
|
|
|
|
ParseII ← (
|
|
|
|
↘+2⊗@:.
|
|
|
|
↘+2⊗@:.
|
|
|
|
⬚0⊜(⊕∘⍘⊟⍉∵(⊟⊃(⊗⊙ColorsII⊢|parse↘2)⇌⊔) regex "\\d+ [rgb]")≠@;.
|
|
|
|
⬚0⊜(⊕∘°⊟⍉∵(⊟⊃(⊗⊙ColorsII⊢|⋕↘2)⇌°□) regex "\\d+ [rgb]")≠@;.
|
|
|
|
↯¯1_3
|
|
|
|
↯¯1_3
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|