AdventOfCode/APL/2021/14.apl

9 lines
539 B
APL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

input ⎕NGET '../.cache/2021/14' 1
⎕PP 32
template input
rules {()¨1 2 7}¨2input
gr {k{/{k2}¨}rules}
next {{w{k (+/{(2)×k}¨w)}¨{}¨w},/{(a b) cxgr ((a x)c)((x b)c)}¨}
solve {{(/)-(/)}{a b({}¨a) {,+/} b} (((1template) 1)),(next) {()()}2,/template}
solve 10
solve 40