advent-of-code/2023/day08/day08.bqn
2024-11-12 21:46:18 +01:00

16 lines
468 B
BQN
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.

Split•Import"../bqn-libs/strings.bqn"
lf@+10
strinststrnet(lflf)Split •FChars"input"
inst"LR"strinst
net{3¨𝕩¨0712}¨lf Split ¯1strnet
els¨net
mapels>12¨net
startendels"AAA""ZZZ"
n30000
•Show 1+(start{𝕩𝕨map}`ninst)end
startsends/¨(¯1¨els)=¨"AZ"
•Show •math.LCM´{1+/(𝕩{𝕩𝕨map}`ninst)ends}¨starts