Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AoC2020 Day 13 Dyalog APL solution from @jayfoad
Credit: @jayfoad (https://github.com/jayfoad/aoc2020apl/blob/main/p13.dyalog)
⎕IO0
ap⎕NGET'p13.txt'1
d¨bc(,'x')¨b'\w+'⎕S'&'p
{()d×}d|-a part 1
⎕PP17 ⎕FR1287
gcd{=0: 1 0 g s t| g t(s-t×÷)}
crt{z÷m×/ m|+/×z×1¨z gcd¨}
(-c)crt d part 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment